From 5f3470fcd0f6b4e8be178b3c18c03de21fd29012 Mon Sep 17 00:00:00 2001 From: Mathieu Malaterre Date: Wed, 26 Feb 2014 11:14:27 +0000 Subject: [PATCH] [trunk] Import patch from sumatrapdf team. This handle testcase 3635.pdf.asan.77.2930 Update issue 225 --- src/lib/openjp2/j2k.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/lib/openjp2/j2k.c b/src/lib/openjp2/j2k.c index 3cdbfcef..5bbad1b9 100644 --- a/src/lib/openjp2/j2k.c +++ b/src/lib/openjp2/j2k.c @@ -4481,6 +4481,14 @@ static OPJ_BOOL opj_j2k_read_rgn (opj_j2k_t *p_j2k, }; #endif /* USE_JPWL */ + /* testcase 3635.pdf.asan.77.2930 */ + if (l_comp_room >= l_nb_comp) { + opj_event_msg(p_manager, EVT_ERROR, + "JPWL: bad component number in RGN (%d when there are only %d)\n", + l_comp_room, l_nb_comp); + return OPJ_FALSE; + } + opj_read_bytes(p_header_data,(OPJ_UINT32 *) (&(l_tcp->tccps[l_comp_no].roishift)),1); /* SPrgn */ ++p_header_data;