mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-12-23 12:43:46 +02:00
j2k & jpeg2000dec: reset numX/Ytiles if tiles failed allocation
Fixes null pointer dereference Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
53f0442464
commit
17e66c9ff4
@ -957,6 +957,8 @@ static int decode_codestream(Jpeg2000DecoderContext *s)
|
||||
switch (marker){
|
||||
case JPEG2000_SIZ:
|
||||
ret = get_siz(s);
|
||||
if (!s->tile)
|
||||
s->numXtiles = s->numYtiles = 0;
|
||||
break;
|
||||
case JPEG2000_COC:
|
||||
ret = get_coc(s, codsty, properties);
|
||||
|
@ -1181,6 +1181,8 @@ static int jpeg2000_read_main_headers(Jpeg2000DecoderContext *s)
|
||||
switch (marker) {
|
||||
case JPEG2000_SIZ:
|
||||
ret = get_siz(s);
|
||||
if (!s->tile)
|
||||
s->numXtiles = s->numYtiles = 0;
|
||||
break;
|
||||
case JPEG2000_COC:
|
||||
ret = get_coc(s, codsty, properties);
|
||||
|
Loading…
Reference in New Issue
Block a user