Commit 189420cb authored by Andreas Cadhalpun's avatar Andreas Cadhalpun Committed by Michael Niedermayer

riffdec: prevent negative bit rate

Signed-off-by: 's avatarAndreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Signed-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent 7da1f00e
......@@ -107,6 +107,14 @@ int ff_get_wav_header(AVFormatContext *s, AVIOContext *pb,
codec->bit_rate = avio_rb32(pb) * 8;
codec->block_align = avio_rb16(pb);
}
if (codec->bit_rate < 0) {
av_log(s, AV_LOG_WARNING,
"Invalid bit rate: %d\n", codec->bit_rate);
if (s->error_recognition & AV_EF_EXPLODE)
return AVERROR_INVALIDDATA;
else
codec->bit_rate = 0;
}
if (size == 14) { /* We're dealing with plain vanilla WAVEFORMAT */
codec->bits_per_coded_sample = 8;
} else {
......
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