diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2014-10-28 15:26:42 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2014-11-02 02:20:10 +0100 |
commit | 808b0ccc03dcdac68eb8b693b5c9a59aa1d62b6d (patch) | |
tree | 9e55db94d959b697200963ec4274a36c715f51c8 /libavcodec | |
parent | 2cf83677b31453868b090e898bb66809b8d18b63 (diff) | |
download | ffmpeg-808b0ccc03dcdac68eb8b693b5c9a59aa1d62b6d.tar.gz |
avcodec/dxa: check dimensions
Fixes out of array access
Fixes: asan_heap-oob_11222fb_21_020.dxa
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit e70312dfc22c4e54d5716f28f28db8f99c74cc90)
Conflicts:
libavcodec/dxa.c
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/dxa.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/libavcodec/dxa.c b/libavcodec/dxa.c index 985b9dab3f..c56c0af210 100644 --- a/libavcodec/dxa.c +++ b/libavcodec/dxa.c @@ -306,6 +306,11 @@ static av_cold int decode_init(AVCodecContext *avctx) avctx->pix_fmt = AV_PIX_FMT_PAL8; + if (avctx->width%4 || avctx->height%4) { + avpriv_request_sample(avctx, "dimensions are not a multiple of 4"); + return AVERROR_INVALIDDATA; + } + c->prev = av_frame_alloc(); if (!c->prev) return AVERROR(ENOMEM); |