babl: always intialize encoding pointer during format construction
authorØyvind Kolås <pippin@gimp.org>
Thu, 30 May 2019 15:50:10 +0000 (17:50 +0200)
committerØyvind Kolås <pippin@gimp.org>
Thu, 30 May 2019 15:57:16 +0000 (17:57 +0200)
This fixes issue #35, we initialize with NULL which will cause
babl_format_get_encoding to itself call babl_get_name rather.

babl/babl-format.c

index 57841964462e8d3b445cd5087fefcd4fb95eac91..accc15a36b99727fe86b78aba61e7fa12b2db1b5 100644 (file)
@@ -127,6 +127,7 @@ format_new (const char      *name,
   babl->format.palette = 0;
 
   babl->format.space = (void*)space;
+  babl->format.encoding = NULL;
 
   return babl;
 }