wavpack: check ch_offset
authorMichael Niedermayer <michaelni@gmx.at>
Tue, 13 Nov 2012 00:05:04 +0000 (01:05 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Tue, 13 Nov 2012 00:11:59 +0000 (01:11 +0100)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/wavpack.c

index 2935abf..b36fa0a 100644 (file)
@@ -789,6 +789,11 @@ static int wavpack_decode_block(AVCodecContext *avctx, int block_no,
         return -1;
     }
 
+    if (wc->ch_offset >= avctx->channels) {
+        av_log(avctx, AV_LOG_ERROR, "too many channels\n");
+        return -1;
+    }
+
     memset(s->decorr, 0, MAX_TERMS * sizeof(Decorr));
     memset(s->ch, 0, sizeof(s->ch));
     s->extra_bits = 0;