summaryrefslogtreecommitdiff
path: root/libavcodec/wmv2dec.c
diff options
context:
space:
mode:
Diffstat (limited to 'libavcodec/wmv2dec.c')
-rw-r--r--libavcodec/wmv2dec.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libavcodec/wmv2dec.c b/libavcodec/wmv2dec.c
index 92daa1639e..124dfdb7e0 100644
--- a/libavcodec/wmv2dec.c
+++ b/libavcodec/wmv2dec.c
@@ -230,6 +230,9 @@ int ff_wmv2_decode_secondary_picture_header(MpegEncContext *s)
s->rl_chroma_table_index = s->rl_table_index;
}
+ if (get_bits_left(&s->gb) < 2)
+ return AVERROR_INVALIDDATA;
+
s->dc_table_index = get_bits1(&s->gb);
s->mv_table_index = get_bits1(&s->gb);