[FFmpeg-cvslog] vqavideo: check the version
Luca Barbato
git at videolan.org
Sat Sep 14 11:06:10 CEST 2013
ffmpeg | branch: release/0.10 | Luca Barbato <lu_zero at gentoo.org> | Thu Jun 27 03:19:05 2013 +0200| [c6942a4b037476ca097036e99bb509b5e5d59128] | committer: Luca Barbato
vqavideo: check the version
Prevent out of buffer write.
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable at libav.org
(cherry picked from commit c4abc9098cacb227dba39bac6aea16b2bceba0d0)
Signed-off-by: Luca Barbato <lu_zero at gentoo.org>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=c6942a4b037476ca097036e99bb509b5e5d59128
---
libavcodec/vqavideo.c | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/libavcodec/vqavideo.c b/libavcodec/vqavideo.c
index 4826650..110d8b1 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:
+ av_log_missing_feature(avctx, "VQA Version 3", 0);
+ return AVERROR_PATCHWELCOME;
+ default:
+ av_log_missing_feature(avctx, "VQA Version", 1);
+ return AVERROR_PATCHWELCOME;
+ }
s->width = AV_RL16(&s->avctx->extradata[6]);
s->height = AV_RL16(&s->avctx->extradata[8]);
if(av_image_check_size(s->width, s->height, 0, avctx)){
More information about the ffmpeg-cvslog
mailing list