[FFmpeg-cvslog] huffyuvdec: check width size for yuv422p
Michael Niedermayer
git at videolan.org
Wed Aug 6 00:22:18 CEST 2014
ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Sun Aug 3 00:54:33 2014 +0100| [a7153444df9040bf6ae103e0bbf6104b66f974cb] | committer: Anton Khirnov
huffyuvdec: check width size for yuv422p
Avoid out of array accesses.
CC: libav-stable at libav.org
Bug-Id: CVE-2013-0848
Signed-off-by: Vittorio Giovara <vittorio.giovara at gmail.com>
Signed-off-by: Anton Khirnov <anton at khirnov.net>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=a7153444df9040bf6ae103e0bbf6104b66f974cb
---
libavcodec/huffyuvdec.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/libavcodec/huffyuvdec.c b/libavcodec/huffyuvdec.c
index dc99d19..d8f31d3 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;
More information about the ffmpeg-cvslog
mailing list