summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libavcodec/mvha.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libavcodec/mvha.c b/libavcodec/mvha.c
index c270063b1c..afe5e511f2 100644
--- a/libavcodec/mvha.c
+++ b/libavcodec/mvha.c
@@ -161,6 +161,9 @@ static int decode_frame(AVCodecContext *avctx,
type = AV_RB32(avpkt->data);
size = AV_RL32(avpkt->data + 4);
+ if (size < 1 || size >= avpkt->size)
+ return AVERROR_INVALIDDATA;
+
if ((ret = ff_get_buffer(avctx, frame, 0)) < 0)
return ret;