Correct leak in color_cielab_to_rgb
authormayeut <mayeut@users.noreply.github.com>
Sun, 13 Sep 2015 12:42:56 +0000 (14:42 +0200)
committermayeut <mayeut@users.noreply.github.com>
Sun, 13 Sep 2015 12:42:56 +0000 (14:42 +0200)
src/bin/common/color.c
src/bin/common/color.h
src/bin/jp2/opj_decompress.c

index d38f3372ef2d7877209bd3f21d1490e3fdd975c4..f4fe7f10d067e5d7f179dc8a86cc07614672e0ed 100644 (file)
@@ -599,13 +599,13 @@ void color_apply_conversion(opj_image_t *image)
                
                transform = cmsCreateTransform(in, TYPE_Lab_DBL, out, TYPE_RGB_16, INTENT_PERCEPTUAL, 0);
                
-#ifdef HAVE_LIBLCMS2
+#ifdef OPJ_HAVE_LIBLCMS2
                cmsCloseProfile(in);
                cmsCloseProfile(out);
 #endif
                if(transform == NULL)
                {
-#ifdef HAVE_LIBLCMS1
+#ifdef OPJ_HAVE_LIBLCMS1
                        cmsCloseProfile(in);
                        cmsCloseProfile(out);
 #endif
@@ -662,7 +662,7 @@ void color_apply_conversion(opj_image_t *image)
                        *blue++ = RGB[2];
                }
                cmsDeleteTransform(transform);
-#ifdef HAVE_LIBLCMS1
+#ifdef OPJ_HAVE_LIBLCMS1
                cmsCloseProfile(in);
                cmsCloseProfile(out);
 #endif
@@ -681,7 +681,7 @@ void color_apply_conversion(opj_image_t *image)
        fprintf(stderr,"%s:%d:\n\tenumCS %d not handled. Ignoring.\n", __FILE__,__LINE__, enumcs);
 }// color_apply_conversion()
 
-#endif // HAVE_LIBLCMS2 || HAVE_LIBLCMS1
+#endif // OPJ_HAVE_LIBLCMS2 || OPJ_HAVE_LIBLCMS1
 
 void color_cmyk_to_rgb(opj_image_t *image)
 {
index c329f87f0fa27125a36224c0a3ce2081aef0a007..0cd78e89e73a165e2c138d3023bd76b92d6fa166 100644 (file)
@@ -40,7 +40,7 @@
 
 extern void color_sycc_to_rgb(opj_image_t *img);
 extern void color_apply_icc_profile(opj_image_t *image);
-extern void color_apply_conversion(opj_image_t *image);
+extern void color_cielab_to_rgb(opj_image_t *image);
 
 extern void color_cmyk_to_rgb(opj_image_t *image);
 extern void color_esycc_to_rgb(opj_image_t *image);
index ac17b69dcef990ccefd3b96124cb352a44f15792..da566ac21ee614c13cd25626294425b1e83cafb5 100644 (file)
@@ -1371,7 +1371,7 @@ int main(int argc, char **argv)
                        if(image->icc_profile_len)
                         color_apply_icc_profile(image);
                        else
-                        color_apply_conversion(image);
+                        color_cielab_to_rgb(image);
 #endif
                        free(image->icc_profile_buf);
                        image->icc_profile_buf = NULL; image->icc_profile_len = 0;