From 6b6b84ae1625ce1e38ff5f1b4c0bf03450066e66 Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Sun, 18 Dec 2011 20:10:51 +0100 Subject: [PATCH] adxdec: Fix division by zero Signed-off-by: Michael Niedermayer --- libavcodec/adxdec.c | 2 ++ 1 file changed, 2 insertions(+) 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); -- 2.11.0