aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2011-12-18 20:10:51 +0100
committerMichael Niedermayer <michaelni@gmx.at>2012-01-03 19:49:55 +0100
commitcb42ed171d698324e16b2dded0ac7d419581a47f (patch)
tree1154c9441c9fec0ede748f97d4c7526da707cff4
parent2bbda9872fabf4038acbc98ceecfc1218a3370a8 (diff)
downloadffmpeg-cb42ed171d698324e16b2dded0ac7d419581a47f.tar.gz
adxdec: Fix division by zero
Signed-off-by: Michael Niedermayer <michaelni@gmx.at> (cherry picked from commit 6b6b84ae1625ce1e38ff5f1b4c0bf03450066e66) Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavcodec/adxdec.c2
1 files changed, 2 insertions, 0 deletions
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);