opj_j2k_update_image_data(): restrict optimized path
authorEven Rouault <even.rouault@spatialys.com>
Fri, 8 Sep 2017 07:53:52 +0000 (09:53 +0200)
committerEven Rouault <even.rouault@spatialys.com>
Fri, 8 Sep 2017 07:53:52 +0000 (09:53 +0200)
src/lib/openjp2/j2k.c

index 8bac309faacb5aaa419bc93ebc840c6af2bea08a..0dad150323625d0301aa9925ec6312bc7ac73fb9 100644 (file)
@@ -9129,6 +9129,7 @@ static OPJ_BOOL opj_j2k_update_image_data(opj_tcd_t * p_tcd,
         /* Allocate output component buffer if necessary */
         if (l_img_comp_dest->data == NULL &&
                 l_start_offset_src == 0 && l_start_offset_dest == 0 &&
+                src_data_stride == l_img_comp_dest->w &&
                 l_width_dest == l_img_comp_dest->w &&
                 l_height_dest == l_img_comp_dest->h) {
             /* If the final image matches the tile buffer, then borrow it */