mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2024-12-14 03:04:53 +00:00
vqavideo: check the version
Prevent out of buffer write.
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
(cherry picked from commit c4abc9098c
)
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
This commit is contained in:
parent
a747cf8873
commit
fb1823e178
@ -135,6 +135,17 @@ static av_cold int vqa_decode_init(AVCodecContext *avctx)
|
|||||||
|
|
||||||
/* load up the VQA parameters from the header */
|
/* load up the VQA parameters from the header */
|
||||||
s->vqa_version = s->avctx->extradata[0];
|
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->width = AV_RL16(&s->avctx->extradata[6]);
|
||||||
s->height = AV_RL16(&s->avctx->extradata[8]);
|
s->height = AV_RL16(&s->avctx->extradata[8]);
|
||||||
if(av_image_check_size(s->width, s->height, 0, avctx)){
|
if(av_image_check_size(s->width, s->height, 0, avctx)){
|
||||||
|
Loading…
Reference in New Issue
Block a user