babl: make babl_model_is deal with NULL input
authorØyvind Kolås <pippin@gimp.org>
Sun, 28 Oct 2018 02:08:30 +0000 (03:08 +0100)
committerØyvind Kolås <pippin@gimp.org>
Sun, 28 Oct 2018 02:23:51 +0000 (03:23 +0100)
babl/babl.c
babl/babl.h

index 979cd46a1e77f42444743ad62a160b424dfb558c..4479f68619bb7ab8702ab0763dcb675fa40b5574 100644 (file)
@@ -185,6 +185,6 @@ babl_exit (void)
 
 int babl_model_is (const Babl *babl, const char *model)
 {
-  return ((babl)==babl_model_with_space(model, babl));
+  return babl && ((babl)==babl_model_with_space(model, babl));
 }
 
index 5a7ca7e946e9c663c45285339bbfe24b2305a3dc..943de993f94b9c8910f566bc9564573be5a2b5fb 100644 (file)
@@ -542,7 +542,7 @@ void babl_space_get (const Babl *space,
  */
 int babl_model_is (const Babl *babl, const char *model_name);
 
-#define babl_model_is(babl,model)  ((babl)==babl_model_with_space(model,babl))
+#define babl_model_is(babl,model)  (babl&&(babl)==babl_model_with_space(model,babl))
 
 
 /**