diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2014-08-03 00:54:33 +0100 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2014-08-05 20:01:59 +0000 |
commit | a7153444df9040bf6ae103e0bbf6104b66f974cb (patch) | |
tree | d946c09c7e20e983656e15e53c3e96cfa36f81b4 /libavcodec/huffyuvdec.c | |
parent | 70cd3b8e659c3522eea5c16a65d14b8658894a94 (diff) | |
download | ffmpeg-a7153444df9040bf6ae103e0bbf6104b66f974cb.tar.gz |
huffyuvdec: check width size for yuv422p
Avoid out of array accesses.
CC: libav-stable@libav.org
Bug-Id: CVE-2013-0848
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
Diffstat (limited to 'libavcodec/huffyuvdec.c')
-rw-r--r-- | libavcodec/huffyuvdec.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/libavcodec/huffyuvdec.c b/libavcodec/huffyuvdec.c index dc99d19a62..d8f31d3dd7 100644 --- a/libavcodec/huffyuvdec.c +++ b/libavcodec/huffyuvdec.c @@ -341,6 +341,13 @@ static av_cold int decode_init(AVCodecContext *avctx) 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) return ret; |