diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2018-01-31 21:20:10 +0300 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2018-02-09 05:01:30 +0300 |
commit | 08c220d26cff51ca2f6896b65aebfa3accc67290 (patch) | |
tree | de75fbe71f9a580039b2fd7f54ad6a20462fbaa4 /libavcodec/huffyuvdec.c | |
parent | cb97400f93ba925485ef0af976cd656b90a9ba86 (diff) |
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/ffmpeg
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec/huffyuvdec.c')
-rw-r--r-- | libavcodec/huffyuvdec.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/libavcodec/huffyuvdec.c b/libavcodec/huffyuvdec.c index 979c4b9d5c..66357bfb40 100644 --- a/libavcodec/huffyuvdec.c +++ b/libavcodec/huffyuvdec.c @@ -919,6 +919,9 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVFrame *const p = data; int table_size = 0, ret; + if (buf_size < (width * height + 7)/8) + return AVERROR_INVALIDDATA; + av_fast_padded_malloc(&s->bitstream_buffer, &s->bitstream_buffer_size, buf_size); |