]> granicus.if.org Git - openjpeg/commitdiff
[trunk] Import patch from sumatrapdf team. This handle testcase 1888.pdf.asan.35.988
authorMathieu Malaterre <mathieu.malaterre@gmail.com>
Wed, 26 Feb 2014 11:26:09 +0000 (11:26 +0000)
committerMathieu Malaterre <mathieu.malaterre@gmail.com>
Wed, 26 Feb 2014 11:26:09 +0000 (11:26 +0000)
Update issue 225

src/lib/openjp2/tcd.c

index fc77b5e48224a916b8e0739db5c1dad0fd9948b9..cba1e245ef44968c9400d5b00683acef1cf442f5 100644 (file)
@@ -663,6 +663,11 @@ OPJ_BOOL FUNCTION (     opj_tcd_t *p_tcd,                        \
         l_tile->y0 = opj_int_max(l_cp->ty0 + q * l_cp->tdy, l_image->y0);                                                                                                                                             \
         l_tile->x1 = opj_int_min(l_cp->tx0 + (p + 1) * l_cp->tdx, l_image->x1);                                                                                                                                       \
         l_tile->y1 = opj_int_min(l_cp->ty0 + (q + 1) * l_cp->tdy, l_image->y1);                                                                                                                                       \
+        /* testcase 1888.pdf.asan.35.988 */ \
+        if (l_tccp->numresolutions == 0) { \
+            fprintf(stderr, "tiles require at least one resolution\n"); \
+            return OPJ_FALSE; \
+        } \
         /*fprintf(stderr, "Tile border = %d,%d,%d,%d\n", l_tile->x0, l_tile->y0,l_tile->x1,l_tile->y1);*/                                                                                                         \
                                                                     \
         /*tile->numcomps = image->numcomps; */                      \