[FFmpeg-cvslog] riff: fix division by zero for G726

Michael Niedermayer git at videolan.org
Tue Oct 16 20:12:44 CEST 2012


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Tue Oct 16 19:56:05 2012 +0200| [340305646a8224eea9a9b8f01a6842b848cfd9c4] | committer: Michael Niedermayer

riff: fix division by zero for G726

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

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

 libavformat/riff.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/riff.c b/libavformat/riff.c
index 1c34112..01ca985 100644
--- a/libavformat/riff.c
+++ b/libavformat/riff.c
@@ -661,7 +661,7 @@ int ff_get_wav_header(AVIOContext *pb, AVCodecContext *codec, int size)
         codec->sample_rate = 0;
     }
     /* override bits_per_coded_sample for G.726 */
-    if (codec->codec_id == AV_CODEC_ID_ADPCM_G726)
+    if (codec->codec_id == AV_CODEC_ID_ADPCM_G726 && codec->sample_rate)
         codec->bits_per_coded_sample = codec->bit_rate / codec->sample_rate;
 
     return 0;



More information about the ffmpeg-cvslog mailing list