babl-space: 0 initialize temporary stack allocated BablSpace instances
authorØyvind Kolås <pippin@gimp.org>
Sat, 20 Jul 2019 13:34:15 +0000 (15:34 +0200)
committerØyvind Kolås <pippin@gimp.org>
Sat, 20 Jul 2019 13:43:21 +0000 (15:43 +0200)
After the CMYK support was added, we ended up sometimes having the is_cmyk
flag set on RGB matrix profiles, leading to forced reference conversions.

babl/babl-space.c

index 10eb04544538719107c642151d5a025e50f4c676..9b71614495de8d5920a6f3e2a140000e2fa76d22 100644 (file)
@@ -227,7 +227,7 @@ _babl_space_for_lcms (const char *icc_data,
                       int         icc_length)
 {
   int i=0;
-  BablSpace space;
+  BablSpace space = {0,};
 
 
   for (i = 0; space_db[i].instance.class_type; i++)
@@ -278,10 +278,9 @@ babl_space_from_rgbxyz_matrix (const char *name,
                                const Babl *trc_blue)
 {
   int i=0;
-  BablSpace space;
+  BablSpace space = {0,};
   space.instance.class_type = BABL_SPACE;
   space.instance.id         = 0;
-
   /* transplant matrixes */
 
   space.RGBtoXYZ[0] = rx;
@@ -374,7 +373,7 @@ babl_space_from_chromaticities (const char *name,
                                 BablSpaceFlags flags)
 {
   int i=0;
-  static BablSpace space;
+  BablSpace space = {0,};
   space.instance.class_type = BABL_SPACE;
   space.instance.id         = 0;