History

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

Michael Niedermayer committed 2 years ago

Commit fde86371 parent ad35eaf1 file · +2 −2Browse files

Unified · Split

libavformat/asf.c+2−2
@@ -90,8 +90,8 @@ static int asf_read_picture(AVFormatContext *s, int len) · 89 unmodified lines
9090 return 0;
9191 }
9292
93− if (picsize >= len) {
94− av_log(s, AV_LOG_ERROR, "Invalid attached picture data size: %d >= %d.\n",
93+ if (picsize >= len || ((int64_t)len - picsize) * 2 + 1 > INT_MAX) {
94+ av_log(s, AV_LOG_ERROR, "Invalid attached picture data size: %d (len = %d).\n",
9595 picsize, len);
9696 return AVERROR_INVALIDDATA;
9797 }

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