palette: allow a NULL space in babl_new_palette_with_space()
authorMichael Natterer <mitch@gimp.org>
Tue, 1 Jan 2019 18:15:40 +0000 (19:15 +0100)
committerMichael Natterer <mitch@gimp.org>
Tue, 1 Jan 2019 18:15:40 +0000 (19:15 +0100)
babl/babl-palette.c

index a53f6549d2bd9bf20d6af68be87d432a8cc2cb47..d03ad1d898d7bca79cf5ecdf61577f04ed22346d 100644 (file)
@@ -727,6 +727,9 @@ const Babl *babl_new_palette_with_space (const char  *name,
 
   char  cname[64];
 
+  if (!space)
+    space = babl_space ("sRGB");
+
   if (!name)
     {
       static int cnt = 0;
@@ -873,7 +876,7 @@ const Babl *babl_new_palette (const char  *name,
                               const Babl **format_u8,
                               const Babl **format_u8_with_alpha)
 {
-  return babl_new_palette_with_space (name, babl_space("sRGB"),
+  return babl_new_palette_with_space (name, NULL,
                                       format_u8, format_u8_with_alpha);
 }