Skip to content
Snippets Groups Projects
Commit a7153444 authored by Michael Niedermayer's avatar Michael Niedermayer Committed by Anton Khirnov
Browse files

huffyuvdec: check width size for yuv422p


Avoid out of array accesses.

CC: libav-stable@libav.org
Bug-Id: CVE-2013-0848
Signed-off-by: default avatarVittorio Giovara <vittorio.giovara@gmail.com>
Signed-off-by: default avatarAnton Khirnov <anton@khirnov.net>
parent 70cd3b8e
No related branches found
No related tags found
No related merge requests found
...@@ -341,6 +341,13 @@ static av_cold int decode_init(AVCodecContext *avctx) ...@@ -341,6 +341,13 @@ static av_cold int decode_init(AVCodecContext *avctx)
return AVERROR_INVALIDDATA; return AVERROR_INVALIDDATA;
} }
if (s->predictor == MEDIAN && avctx->pix_fmt == AV_PIX_FMT_YUV422P &&
avctx->width % 4) {
av_log(avctx, AV_LOG_ERROR, "width must be multiple of 4 "
"for this combination of colorspace and predictor type.\n");
return AVERROR_INVALIDDATA;
}
if ((ret = ff_huffyuv_alloc_temp(s)) < 0) if ((ret = ff_huffyuv_alloc_temp(s)) < 0)
return ret; return ret;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment