From: Michael Niedermayer <[email protected]> Fixes a null pointer dereference.
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <[email protected]> --- libavcodec/jpeg2kdec.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/libavcodec/jpeg2kdec.c b/libavcodec/jpeg2kdec.c index ad27a0d..4dd6981 100644 --- a/libavcodec/jpeg2kdec.c +++ b/libavcodec/jpeg2kdec.c @@ -1160,6 +1160,7 @@ static int jpeg2k_decode_tile(Jpeg2KDecoderContext *s, Jpeg2KTile *tile, if (s->precision <= 8) { for (compno = 0; compno < s->ncomponents; compno++) { Jpeg2KComponent *comp = tile->comp + compno; + Jpeg2KCodingStyle *codsty = tile->codsty + compno; float *datap = comp->f_data; int32_t *i_datap = comp->i_data; int cbps = s->cbps[compno]; @@ -1173,7 +1174,7 @@ static int jpeg2k_decode_tile(Jpeg2KDecoderContext *s, Jpeg2KTile *tile, x = tile->comp[compno].coord[0][0] - s->image_offset_x; dst = line + x * s->ncomponents + compno; - if (tile->codsty->transform == FF_DWT97) { + if (codsty->transform == FF_DWT97) { for (; x < w; x += s->cdx[compno]) { int val = lrintf(*datap) + (1 << (cbps - 1)); /* DC level shift and clip see ISO 15444-1:2002 G.1.2 */ @@ -1198,6 +1199,7 @@ static int jpeg2k_decode_tile(Jpeg2KDecoderContext *s, Jpeg2KTile *tile, } else { for (compno = 0; compno < s->ncomponents; compno++) { Jpeg2KComponent *comp = tile->comp + compno; + Jpeg2KCodingStyle *codsty = tile->codsty + compno; float *datap = comp->f_data; int32_t *i_datap = comp->i_data; uint16_t *linel; @@ -1210,7 +1212,7 @@ static int jpeg2k_decode_tile(Jpeg2KDecoderContext *s, Jpeg2KTile *tile, uint16_t *dst; x = tile->comp[compno].coord[0][0] - s->image_offset_x; dst = linel + (x * s->ncomponents + compno); - if (tile->codsty->transform == FF_DWT97) { + if (codsty->transform == FF_DWT97) { for (; x < w; x += s-> cdx[compno]) { int val = lrintf(*datap) + (1 << (cbps - 1)); /* DC level shift and clip see ISO 15444-1:2002 G.1.2 */ -- 1.7.9.5 _______________________________________________ libav-devel mailing list [email protected] https://lists.libav.org/mailman/listinfo/libav-devel
