avformat/asf: Check picsize

Fixes: signed integer overflow: 1073750247 * 2 cannot be represented in type 'int'
Fixes: 70722/clusterfuzz-testcase-minimized-ffmpeg_dem_ASF_O_fuzzer-5447231587549184

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
release/7.1
Michael Niedermayer 3 months ago
parent ad35eaf848
commit fde8637fda
No known key found for this signature in database
GPG Key ID: B18E8928B3948D64
  1. 4
      libavformat/asf.c

@ -90,8 +90,8 @@ static int asf_read_picture(AVFormatContext *s, int len)
return 0;
}
if (picsize >= len) {
av_log(s, AV_LOG_ERROR, "Invalid attached picture data size: %d >= %d.\n",
if (picsize >= len || ((int64_t)len - picsize) * 2 + 1 > INT_MAX) {
av_log(s, AV_LOG_ERROR, "Invalid attached picture data size: %d (len = %d).\n",
picsize, len);
return AVERROR_INVALIDDATA;
}

Loading…
Cancel
Save