aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/vqavideo.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2015-05-13 00:41:38 +0200
committerMichael Niedermayer <michaelni@gmx.at>2015-05-13 00:41:38 +0200
commit8a62b80ce6c8e87e7937f9a5d68f83882c1c8da2 (patch)
treece7623d42a53f6c171a1ac5e4402ef30b0827833 /libavcodec/vqavideo.c
parentec38a1ba404b8cb8d71ccee2b8dcd6f3fcbde273 (diff)
downloadffmpeg-8a62b80ce6c8e87e7937f9a5d68f83882c1c8da2.tar.gz
avcodec/vqavideo: Check chunk size
Fixes CID1239154 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/vqavideo.c')
-rw-r--r--libavcodec/vqavideo.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/libavcodec/vqavideo.c b/libavcodec/vqavideo.c
index 2ad614d2a7..45eb1574f6 100644
--- a/libavcodec/vqavideo.c
+++ b/libavcodec/vqavideo.c
@@ -231,6 +231,12 @@ static int decode_format80(VqaContext *s, int src_size,
unsigned char color;
int i;
+ if (src_size < 0 || src_size > bytestream2_get_bytes_left(&s->gb)) {
+ av_log(s->avctx, AV_LOG_ERROR, "Chunk size %d is out of range\n",
+ src_size);
+ return AVERROR_INVALIDDATA;
+ }
+
start = bytestream2_tell(&s->gb);
while (bytestream2_tell(&s->gb) - start < src_size) {
opcode = bytestream2_get_byte(&s->gb);