adxdec: Fix division by zero
authorMichael Niedermayer <michaelni@gmx.at>
Sun, 18 Dec 2011 19:10:51 +0000 (20:10 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Tue, 3 Jan 2012 18:49:55 +0000 (19:49 +0100)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 6b6b84ae1625ce1e38ff5f1b4c0bf03450066e66)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/adxdec.c

index 20f2606..cf494c1 100644 (file)
@@ -120,6 +120,8 @@ static int adx_decode_frame(AVCodecContext *avctx, void *data,
         buf += header_size;
         buf_size -= header_size;
     }
+    if(c->channels <= 0)
+        return AVERROR_INVALIDDATA;
 
     /* calculate number of blocks in the packet */
     num_blocks = buf_size / (BLOCK_SIZE * c->channels);