Commit 34030564 authored by Michael Niedermayer's avatar Michael Niedermayer

riff: fix division by zero for G726

Fixes CID717752
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 9de5b11d
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment