mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-12-14 02:50:11 +01:00
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 e70312dfc2)
Conflicts:
libavcodec/dxa.c
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
@@ -301,6 +301,11 @@ static av_cold int decode_init(AVCodecContext *avctx)
|
|||||||
c->avctx = avctx;
|
c->avctx = avctx;
|
||||||
avctx->pix_fmt = PIX_FMT_PAL8;
|
avctx->pix_fmt = PIX_FMT_PAL8;
|
||||||
|
|
||||||
|
if (avctx->width%4 || avctx->height%4) {
|
||||||
|
av_log(avctx, AV_LOG_ERROR, "dimensions are not a multiple of 4");
|
||||||
|
return AVERROR_INVALIDDATA;
|
||||||
|
}
|
||||||
|
|
||||||
avcodec_get_frame_defaults(&c->pic);
|
avcodec_get_frame_defaults(&c->pic);
|
||||||
avcodec_get_frame_defaults(&c->prev);
|
avcodec_get_frame_defaults(&c->prev);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user