[FFmpeg-cvslog] adpcm: fix division by zero in fate/creative/intro-partial. wav with -s 2 and -r 0.001:1

Michael Niedermayer git at videolan.org
Sat Dec 10 18:53:06 CET 2011


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Sat Dec 10 14:55:23 2011 +0100| [257c85cddde8633caffb76e97e9710b1aebfc511] | committer: Michael Niedermayer

adpcm: fix division by zero in fate/creative/intro-partial.wav with -s 2 and -r 0.001:1

Bug-Found-by: Shitiz Garg
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

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

 libavcodec/adpcm.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/libavcodec/adpcm.c b/libavcodec/adpcm.c
index e305220..cee1eed 100644
--- a/libavcodec/adpcm.c
+++ b/libavcodec/adpcm.c
@@ -340,6 +340,9 @@ static int get_nb_samples(AVCodecContext *avctx, const uint8_t *buf,
 
     *coded_samples = 0;
 
+    if(ch <= 0)
+        return 0;
+
     switch (avctx->codec->id) {
     /* constant, only check buf_size */
     case CODEC_ID_ADPCM_EA_XAS:



More information about the ffmpeg-cvslog mailing list