From: Michael Niedermayer Date: Sun, 18 Dec 2011 19:10:51 +0000 (+0100) Subject: adxdec: Fix division by zero X-Git-Tag: android-x86-4.4-r1~14357 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=6b6b84ae1625ce1e38ff5f1b4c0bf03450066e66;p=android-x86%2Fexternal-ffmpeg.git adxdec: Fix division by zero Signed-off-by: Michael Niedermayer --- diff --git a/libavcodec/adxdec.c b/libavcodec/adxdec.c index 20f2606a90..cf494c12d4 100644 --- a/libavcodec/adxdec.c +++ b/libavcodec/adxdec.c @@ -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);