Fixes: signed integer overflow: 2147483647 + 1 cannot be represented in type 'int32_t' (aka 'int') Fixes: 51896/clusterfuzz-testcase-minimized-ffmpeg_dem_RPL_fuzzer-6086131095830528
Showing the changes to libavformat (1 of 1 file). Show all
Unified · Split
| @@ -268,6 +268,9 @@ static int rpl_read_header(AVFormatContext *s) · 267 unmodified lines | ||
| 268 | 268 | "Video stream will be broken!\n", av_fourcc2str(vst->codecpar->codec_tag)); |
| 269 | 269 | |
| 270 | 270 | number_of_chunks = read_line_and_int(pb, &error); // number of chunks in the file |
| 271 | + if (number_of_chunks == INT_MAX) | |
| 272 | + return AVERROR_INVALIDDATA; | |
| 273 | + | |
| 271 | 274 | // The number in the header is actually the index of the last chunk. |
| 272 | 275 | number_of_chunks++; |
| 273 | 276 | |