Commit 872fcfcc authored by Andreas Cadhalpun's avatar Andreas Cadhalpun

bfi: validate sample_rate

A negative sample rate doesn't make sense and triggers assertions in
av_rescale_rnd.
Reviewed-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
Signed-off-by: 's avatarAndreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
parent 2eb05eaa
......@@ -88,6 +88,10 @@ static int bfi_read_header(AVFormatContext * s)
vstream->codecpar->extradata_size);
astream->codecpar->sample_rate = avio_rl32(pb);
if (astream->codecpar->sample_rate <= 0) {
av_log(s, AV_LOG_ERROR, "Invalid sample rate %d\n", astream->codecpar->sample_rate);
return AVERROR_INVALIDDATA;
}
/* Set up the video codec... */
avpriv_set_pts_info(vstream, 32, 1, fps);
......
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