aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/vqavideo.c
diff options
context:
space:
mode:
authorLuca Barbato <lu_zero@gentoo.org>2013-06-27 03:19:05 +0200
committerLuca Barbato <lu_zero@gentoo.org>2013-07-07 22:04:05 +0200
commitc4abc9098cacb227dba39bac6aea16b2bceba0d0 (patch)
tree1f281d323eb7c96df2e22c31e46200b8dad07633 /libavcodec/vqavideo.c
parent636ced8e1dc8248a1353b416240b93d70ad03edb (diff)
downloadffmpeg-c4abc9098cacb227dba39bac6aea16b2bceba0d0.tar.gz
vqavideo: check the version
Prevent out of buffer write. Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind CC: libav-stable@libav.org
Diffstat (limited to 'libavcodec/vqavideo.c')
-rw-r--r--libavcodec/vqavideo.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/libavcodec/vqavideo.c b/libavcodec/vqavideo.c
index ed4d8147cb..98f82ad571 100644
--- a/libavcodec/vqavideo.c
+++ b/libavcodec/vqavideo.c
@@ -134,6 +134,17 @@ static av_cold int vqa_decode_init(AVCodecContext *avctx)
/* load up the VQA parameters from the header */
s->vqa_version = s->avctx->extradata[0];
+ switch (s->vqa_version) {
+ case 1:
+ case 2:
+ break;
+ case 3:
+ avpriv_report_missing_feature(avctx, "VQA Version %d", s->vqa_version);
+ return AVERROR_PATCHWELCOME;
+ default:
+ avpriv_request_sample(avctx, "VQA Version %i", s->vqa_version);
+ return AVERROR_PATCHWELCOME;
+ }
s->width = AV_RL16(&s->avctx->extradata[6]);
s->height = AV_RL16(&s->avctx->extradata[8]);
if ((ret = av_image_check_size(s->width, s->height, 0, avctx)) < 0) {