mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-01-13 21:28:01 +02: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>
This commit is contained in:
parent
beb944786e
commit
e70312dfc2
@ -329,6 +329,11 @@ static av_cold int decode_init(AVCodecContext *avctx)
|
|||||||
{
|
{
|
||||||
DxaDecContext * const c = avctx->priv_data;
|
DxaDecContext * const c = avctx->priv_data;
|
||||||
|
|
||||||
|
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();
|
c->prev = av_frame_alloc();
|
||||||
if (!c->prev)
|
if (!c->prev)
|
||||||
return AVERROR(ENOMEM);
|
return AVERROR(ENOMEM);
|
||||||
|
Loading…
Reference in New Issue
Block a user