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

src/lib/openjp2/j2k.c

index aa4f1d1dbcf35b9f79b34c5b02abcc24e9f9e29e..792c1c9fb46b592b8abb2f3ef5697463819342d2 100644 (file)
@@ -7766,6 +7766,10 @@ OPJ_BOOL opj_j2k_update_image_data (opj_tcd_t * p_tcd, OPJ_BYTE * p_data, opj_im
                 if( (l_offset_x0_src < 0 ) || (l_offset_y0_src < 0 ) || (l_offset_x1_src < 0 ) || (l_offset_y1_src < 0 ) ){
                         return OPJ_FALSE;
                 }
+                /* testcase 2977.pdf.asan.67.2198 */
+                if ((OPJ_INT32)l_width_dest < 0 || (OPJ_INT32)l_height_dest < 0) {
+                        return OPJ_FALSE;
+                }
                 /*-----*/
 
                 /* Compute the input buffer offset */