History

avformat/nutdec: Check fields

Fixes: signed integer overflow: -2147483648 - 1 cannot be represented in type 'int' Fixes: 50993/clusterfuzz-testcase-minimized-ffmpeg_dem_NUT_fuzzer-6566001610719232

Michael Niedermayer committed 4 years ago

Commit 2c146401 parent 7124f101 file · +5 −0Browse files

Unified · Split

libavformat/nutdec.c+5−0
@@ -245,6 +245,11 @@ static int decode_main_header(NUTContext *nut) · 244 unmodified lines
245245 for (i = 0; i < 256;) {
246246 int tmp_flags = ffio_read_varlen(bc);
247247 int tmp_fields = ffio_read_varlen(bc);
248+ if (tmp_fields < 0) {
249+ av_log(s, AV_LOG_ERROR, "fields %d is invalid\n", tmp_fields);
250+ ret = AVERROR_INVALIDDATA;
251+ goto fail;
252+ }
248253
249254 if (tmp_fields > 0)
250255 tmp_pts = get_s(bc);

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