From 257c85cddde8633caffb76e97e9710b1aebfc511 Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Sat, 10 Dec 2011 14:55:23 +0100 Subject: [PATCH] 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 --- libavcodec/adpcm.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libavcodec/adpcm.c b/libavcodec/adpcm.c index e305220af5..cee1eed7bd 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: