[FFmpeg-cvslog] adxdec: Fix division by zero

Michael Niedermayer git at videolan.org
Sun Dec 18 20:54:22 CET 2011


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Sun Dec 18 20:10:51 2011 +0100| [6b6b84ae1625ce1e38ff5f1b4c0bf03450066e66] | committer: Michael Niedermayer

adxdec: Fix division by zero

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=6b6b84ae1625ce1e38ff5f1b4c0bf03450066e66
---

 libavcodec/adxdec.c |    2 ++
 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);



More information about the ffmpeg-cvslog mailing list