summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorMathieu Malaterre <mathieu.malaterre@gmail.com>2014-02-26 11:09:20 +0000
committerMathieu Malaterre <mathieu.malaterre@gmail.com>2014-02-26 11:09:20 +0000
commit0ae6ff80187bbd8d9467b500799cb752b3f921c0 (patch)
tree855e0322cfb5dfca9ae13cdf9a906b06a8e0465c /src/lib
parent241769dc2fac48b9ba6527fe62d536998dda4fa3 (diff)
[trunk] Import patch from sumatrapdf team. This handle testcase 2539.pdf.SIGFPE.706.1712
Update issue 225
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/openjp2/j2k.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/lib/openjp2/j2k.c b/src/lib/openjp2/j2k.c
index 52cf06c5..a6397eff 100644
--- a/src/lib/openjp2/j2k.c
+++ b/src/lib/openjp2/j2k.c
@@ -1959,6 +1959,11 @@ static OPJ_BOOL opj_j2k_read_siz(opj_j2k_t *p_j2k,
opj_event_msg(p_manager, EVT_ERROR, "Error with SIZ marker: negative image size (%d x %d)\n", l_image->x1 - l_image->x0, l_image->y1 - l_image->y0);
return OPJ_FALSE;
}
+ /* testcase 2539.pdf.SIGFPE.706.1712 (also 3622.pdf.SIGFPE.706.2916 and 4008.pdf.SIGFPE.706.3345 and maybe more) */
+ if (!(l_cp->tdx * l_cp->tdy)) {
+ opj_event_msg(p_manager, EVT_ERROR, "Error with SIZ marker: invalid tile size (tdx: %d, tdy: %d)\n", l_cp->tdx, l_cp->tdy);
+ return OPJ_FALSE;
+ }
#ifdef USE_JPWL
if (l_cp->correct) {