Commit 08c220d2 authored by Michael Niedermayer's avatar Michael Niedermayer

avcodec/huffyuvdec: Check input buffer size

Fixes: Timeout
Fixes: 5487/clusterfuzz-testcase-4696837035393024

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpegReviewed-by: 's avatarPaul B Mahol <onemda@gmail.com>
Signed-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent cb97400f
...@@ -919,6 +919,9 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, ...@@ -919,6 +919,9 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
AVFrame *const p = data; AVFrame *const p = data;
int table_size = 0, ret; int table_size = 0, ret;
if (buf_size < (width * height + 7)/8)
return AVERROR_INVALIDDATA;
av_fast_padded_malloc(&s->bitstream_buffer, av_fast_padded_malloc(&s->bitstream_buffer,
&s->bitstream_buffer_size, &s->bitstream_buffer_size,
buf_size); buf_size);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment