aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorLaurent Aimar <fenrir@videolan.org>2011-10-08 23:40:39 +0200
committerMichael Niedermayer <michaelni@gmx.at>2011-11-04 01:00:54 +0100
commit2fdbc1d5533ce596bc7e4872dd801c5cdda58aeb (patch)
tree22b01f15e2ebc983be6547c56acafd1b8bda5b19 /libavcodec
parent5415c488f9c6103df06ccfdc77dd50d1f030d271 (diff)
downloadffmpeg-2fdbc1d5533ce596bc7e4872dd801c5cdda58aeb.tar.gz
vqavideo: check for invalid/unsupported version
Signed-off-by: Michael Niedermayer <michaelni@gmx.at> (cherry picked from commit b226af39107f09cd650875388250f4968eea54db) Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/vqavideo.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libavcodec/vqavideo.c b/libavcodec/vqavideo.c
index ca4fd94d75..6d7f65a051 100644
--- a/libavcodec/vqavideo.c
+++ b/libavcodec/vqavideo.c
@@ -138,6 +138,10 @@ static av_cold int vqa_decode_init(AVCodecContext *avctx)
/* load up the VQA parameters from the header */
vqa_header = (unsigned char *)s->avctx->extradata;
s->vqa_version = vqa_header[0];
+ if (s->vqa_version < 1 || s->vqa_version > 3) {
+ av_log(s->avctx, AV_LOG_ERROR, " VQA video: unsupported version %d\n", s->vqa_version);
+ return -1;
+ }
s->width = AV_RL16(&vqa_header[6]);
s->height = AV_RL16(&vqa_header[8]);
if(av_image_check_size(s->width, s->height, 0, avctx)){