avformat/bfi: check nframes

Fixes: signed integer overflow: -2147483648 - 1 cannot be represented in type 'int'
Fixes: 29102/clusterfuzz-testcase-minimized-ffmpeg_dem_BFI_fuzzer-6737028768202752

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
pull/361/merge
Michael Niedermayer 4 years ago
parent 527821a2dd
commit b4e77dfca1
  1. 2
      libavformat/bfi.c

@ -73,6 +73,8 @@ static int bfi_read_header(AVFormatContext * s)
return AVERROR_INVALIDDATA;
bfi->nframes = avio_rl32(pb);
if (bfi->nframes < 0)
return AVERROR_INVALIDDATA;
avio_rl32(pb);
avio_rl32(pb);
avio_rl32(pb);

Loading…
Cancel
Save