History

avformat/rpl: Check for number_of_chunks overflow

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

Michael Niedermayer committed 3 years ago

Commit b3c973a1 parent 3508b491 file · +3 −0Browse files

Showing the changes to libavformat (1 of 1 file). Show all

Unified · Split

libavformat/rpl.c+3−0
@@ -268,6 +268,9 @@ static int rpl_read_header(AVFormatContext *s) · 267 unmodified lines
268268 "Video stream will be broken!\n", av_fourcc2str(vst->codecpar->codec_tag));
269269
270270 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+
271274 // The number in the header is actually the index of the last chunk.
272275 number_of_chunks++;
273276

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t