mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-12-12 18:10:13 +01:00
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>
(cherry picked from commit a7153444df)
Signed-off-by: Anton Khirnov <anton@khirnov.net>
Conflicts:
libavcodec/huffyuvdec.c
This commit is contained in:
committed by
Anton Khirnov
parent
e17dc0a254
commit
a1804df66a
@@ -538,6 +538,13 @@ s->bgr32=1;
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
|
||||
if (s->predictor == MEDIAN && avctx->pix_fmt == 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;
|
||||
}
|
||||
|
||||
alloc_temp(s);
|
||||
|
||||
// av_log(NULL, AV_LOG_DEBUG, "pred:%d bpp:%d hbpp:%d il:%d\n", s->predictor, s->bitstream_bpp, avctx->bits_per_coded_sample, s->interlaced);
|
||||
|
||||
Reference in New Issue
Block a user