diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2011-12-18 20:10:51 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-01-03 19:49:55 +0100 |
commit | cb42ed171d698324e16b2dded0ac7d419581a47f (patch) | |
tree | 1154c9441c9fec0ede748f97d4c7526da707cff4 | |
parent | 2bbda9872fabf4038acbc98ceecfc1218a3370a8 (diff) | |
download | ffmpeg-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.c | 2 |
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); |