diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-11-29 15:56:05 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-11-29 15:56:36 +0100 |
commit | 6abb9a901fca27da14d4fffbb01948288b5da3ba (patch) | |
tree | d25575c5397652cca8a68ed84c96b68169b7d3ab | |
parent | 27eada287af5505a93a4b9410412c0a916117731 (diff) | |
download | ffmpeg-streaming-6abb9a901fca27da14d4fffbb01948288b5da3ba.zip ffmpeg-streaming-6abb9a901fca27da14d4fffbb01948288b5da3ba.tar.gz |
huffyuvdec: check width more completely, avoid out of array accesses
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | libavcodec/huffyuv.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/libavcodec/huffyuv.c b/libavcodec/huffyuv.c index 6e88114..ca5bcd8 100644 --- a/libavcodec/huffyuv.c +++ b/libavcodec/huffyuv.c @@ -514,7 +514,10 @@ static av_cold int decode_init(AVCodecContext *avctx) av_log(avctx, AV_LOG_ERROR, "width must be even for this colorspace\n"); 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 a multiple of 4 this colorspace and predictor\n"); + return AVERROR_INVALIDDATA; + } alloc_temp(s); return 0; |