History

avcodec/agm: Check output size before allocation

Fixes: OOM Fixes: 14198/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_AGM_fuzzer-5723579234123776

Michael Niedermayer committed 7 years ago

Commit 19af9481 parent f4a1b8d1 file · +3 −0Browse files

Unified · Split

libavcodec/agm.c+3−0
@@ -1049,6 +1049,9 @@ static int decode_huffman2(AVCodecContext *avctx, int header, int size) · 1048 unmodified lines
10491049
10501050 s->output_size = get_bits_long(gb, 32);
10511051
1052+ if (s->output_size > avctx->width * avctx->height * 9LL + 10000)
1053+ return AVERROR_INVALIDDATA;
1054+
10521055 av_fast_padded_malloc(&s->output, &s->padded_output_size, s->output_size);
10531056 if (!s->output)
10541057 return AVERROR(ENOMEM);

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