mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-12-23 12:43:46 +02:00
jpeg2000: Check that nreslevels2decode has been initialized before use
Avoid buffer overread. Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
This commit is contained in:
parent
86a2602e16
commit
78962d3df4
@ -206,6 +206,11 @@ int ff_jpeg2000_init_component(Jpeg2000Component *comp,
|
||||
int reslevelno, bandno, gbandno = 0, ret, i, j;
|
||||
uint32_t csize = 1;
|
||||
|
||||
if (!codsty->nreslevels2decode) {
|
||||
av_log(avctx, AV_LOG_ERROR, "nreslevels2decode uninitialized\n");
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
|
||||
if (ret = ff_jpeg2000_dwt_init(&comp->dwt, comp->coord,
|
||||
codsty->nreslevels2decode - 1,
|
||||
codsty->transform))
|
||||
|
Loading…
Reference in New Issue
Block a user