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
1049 1049
1050 s->output_size = get_bits_long(gb, 32);1050 s->output_size = get_bits_long(gb, 32);
1051 1051
1052 if (s->output_size > avctx->width * avctx->height * 9LL + 10000)
1053 return AVERROR_INVALIDDATA;
1054
1052 av_fast_padded_malloc(&s->output, &s->padded_output_size, s->output_size);1055 av_fast_padded_malloc(&s->output, &s->padded_output_size, s->output_size);
1053 if (!s->output)1056 if (!s->output)
1054 return AVERROR(ENOMEM);1057 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