summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorMathieu Malaterre <mathieu.malaterre@gmail.com>2014-02-26 11:09:59 +0000
committerMathieu Malaterre <mathieu.malaterre@gmail.com>2014-02-26 11:09:59 +0000
commit7195a23a9d761d00bcf674ad1424648435fcfc57 (patch)
tree43a844fa803d018a5c34676980b44f013777df6a /src/lib
parent0ae6ff80187bbd8d9467b500799cb752b3f921c0 (diff)
[trunk] Import patch from sumatrapdf team. This handle testcase 1610.pdf.SIGSEGV.59c.681
Update issue 225
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/openjp2/j2k.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/lib/openjp2/j2k.c b/src/lib/openjp2/j2k.c
index a6397eff..120e94fc 100644
--- a/src/lib/openjp2/j2k.c
+++ b/src/lib/openjp2/j2k.c
@@ -1965,6 +1965,12 @@ static OPJ_BOOL opj_j2k_read_siz(opj_j2k_t *p_j2k,
return OPJ_FALSE;
}
+ /* testcase 1610.pdf.SIGSEGV.59c.681 */
+ if (((OPJ_UINT64)l_image->x1) * ((OPJ_UINT64)l_image->y1) != (l_image->x1 * l_image->y1)) {
+ opj_event_msg(p_manager, EVT_ERROR, "Prevent buffer overflow (x1: %d, y1: %d)", l_image->x1, l_image->y1);
+ return OPJ_FALSE;
+ }
+
#ifdef USE_JPWL
if (l_cp->correct) {
/* if JPWL is on, we check whether TX errors have damaged