OSDN Git Service

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>
Sun, 18 Dec 2011 19:49:34 +0000 (20:49 +0100)
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);