diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2019-08-12 00:21:49 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2019-09-04 20:26:35 +0200 |
commit | b34033dec24aa7879d3e14f185d85fb4b9827a66 (patch) | |
tree | f5d81ac20bc3fac4a114b8a4d5f4791a822b0c31 /libavcodec | |
parent | 7a9b43671a3c9095b944b6c88fa4afe383774953 (diff) | |
download | ffmpeg-b34033dec24aa7879d3e14f185d85fb4b9827a66.tar.gz |
avcodec/vb: Check input packet size to be large enough to contain flags
Fixes: Timeout (->9sec)
Fixes: 16292/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_VB_fuzzer-5747063496638464
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit dea2591d4fbc989ca82bc8a8ad7d16aacdc89af1)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/vb.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/libavcodec/vb.c b/libavcodec/vb.c index c6dd6fb456..d9c6b93a73 100644 --- a/libavcodec/vb.c +++ b/libavcodec/vb.c @@ -199,6 +199,9 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, uint32_t size; int offset = 0; + if (avpkt->size < 2) + return AVERROR_INVALIDDATA; + bytestream2_init(&c->stream, avpkt->data, avpkt->size); if ((ret = ff_get_buffer(avctx, frame, 0)) < 0) |