[babl] babl: make babl_model_is deal with NULL input
- From: Øyvind "pippin" Kolås <ok src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [babl] babl: make babl_model_is deal with NULL input
- Date: Sun, 28 Oct 2018 02:24:32 +0000 (UTC)
commit e62e0194a08c04d0125d7e725ea262f93110d49d
Author: Øyvind Kolås <pippin gimp org>
Date: Sun Oct 28 03:08:30 2018 +0100
babl: make babl_model_is deal with NULL input
babl/babl.c | 2 +-
babl/babl.h | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/babl/babl.c b/babl/babl.c
index 979cd46..4479f68 100644
--- a/babl/babl.c
+++ b/babl/babl.c
@@ -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));
}
diff --git a/babl/babl.h b/babl/babl.h
index 5a7ca7e..943de99 100644
--- a/babl/babl.h
+++ b/babl/babl.h
@@ -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))
/**
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]