summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libavcodec/vb.c3
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)