summaryrefslogtreecommitdiffstats
path: root/libavcodec/adxdec.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2011-12-18 20:10:51 +0100
committerMichael Niedermayer <michaelni@gmx.at>2011-12-18 20:49:34 +0100
commit6b6b84ae1625ce1e38ff5f1b4c0bf03450066e66 (patch)
tree78810e36e0fa8d98ac8283834915fd78833309b3 /libavcodec/adxdec.c
parentbdd62a615a74ba7d29b528263462937da132c62c (diff)
downloadffmpeg-streaming-6b6b84ae1625ce1e38ff5f1b4c0bf03450066e66.zip
ffmpeg-streaming-6b6b84ae1625ce1e38ff5f1b4c0bf03450066e66.tar.gz
adxdec: Fix division by zero
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/adxdec.c')
-rw-r--r--libavcodec/adxdec.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libavcodec/adxdec.c b/libavcodec/adxdec.c
index 20f2606..cf494c1 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);
OpenPOWER on IntegriCloud