summaryrefslogtreecommitdiff
path: root/libavcodec/mvha.c
diff options
context:
space:
mode:
Diffstat (limited to 'libavcodec/mvha.c')
-rw-r--r--libavcodec/mvha.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libavcodec/mvha.c b/libavcodec/mvha.c
index 1ea3bb3d76..c603ef6975 100644
--- a/libavcodec/mvha.c
+++ b/libavcodec/mvha.c
@@ -233,6 +233,8 @@ static int decode_frame(AVCodecContext *avctx,
dst = frame->data[p] + (avctx->height - 1) * frame->linesize[p];
for (int y = 0; y < avctx->height; y++) {
+ if (get_bits_left(gb) < width)
+ return AVERROR_INVALIDDATA;
for (int x = 0; x < width; x++) {
int v = get_vlc2(gb, s->vlc.table, s->vlc.bits, 3);