[FFmpeg-cvslog] vqavideo: check for invalid/unsupported version

Laurent Aimar git at videolan.org
Sun Oct 9 03:31:27 CEST 2011


ffmpeg | branch: master | Laurent Aimar <fenrir at videolan.org> | Sat Oct  8 23:40:39 2011 +0200| [b226af39107f09cd650875388250f4968eea54db] | committer: Michael Niedermayer

vqavideo: check for invalid/unsupported version

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=b226af39107f09cd650875388250f4968eea54db
---

 libavcodec/vqavideo.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/libavcodec/vqavideo.c b/libavcodec/vqavideo.c
index 6772109..18efa10 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)){



More information about the ffmpeg-cvslog mailing list