diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2011-12-10 14:55:23 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2011-12-10 18:51:48 +0100 |
commit | 257c85cddde8633caffb76e97e9710b1aebfc511 (patch) | |
tree | 83d058d486cfdcdbeafb4af184aede8ef79ac469 /libavcodec | |
parent | 337ce558b696f49138a1ef170b219fe73b955b51 (diff) | |
download | ffmpeg-257c85cddde8633caffb76e97e9710b1aebfc511.tar.gz |
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@gmx.at>
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/adpcm.c | 3 |
1 files changed, 3 insertions, 0 deletions
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: |