mirror of https://git.ffmpeg.org/ffmpeg.git
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 dea2591d4f
)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
f4431b6b0c
commit
db421282be
|
@ -199,6 +199,9 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
|
||||||
uint32_t size;
|
uint32_t size;
|
||||||
int offset = 0;
|
int offset = 0;
|
||||||
|
|
||||||
|
if (avpkt->size < 2)
|
||||||
|
return AVERROR_INVALIDDATA;
|
||||||
|
|
||||||
bytestream2_init(&c->stream, avpkt->data, avpkt->size);
|
bytestream2_init(&c->stream, avpkt->data, avpkt->size);
|
||||||
|
|
||||||
if ((ret = ff_get_buffer(avctx, frame, 0)) < 0)
|
if ((ret = ff_get_buffer(avctx, frame, 0)) < 0)
|
||||||
|
|
Loading…
Reference in New Issue