[babl] tools: babl-icc-rewrite; abort with error message instead of segfault
- From: Øyvind Kolås <ok src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [babl] tools: babl-icc-rewrite; abort with error message instead of segfault
- Date: Sat, 2 Sep 2017 13:34:29 +0000 (UTC)
commit f9728d71db3bbb8beedfd0edb91466439120b66e
Author: Øyvind Kolås <pippin gimp org>
Date: Sat Sep 2 15:32:23 2017 +0200
tools: babl-icc-rewrite; abort with error message instead of segfault
tools/babl-icc-rewrite.c | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
---
diff --git a/tools/babl-icc-rewrite.c b/tools/babl-icc-rewrite.c
index bf18bc7..bb1bc64 100644
--- a/tools/babl-icc-rewrite.c
+++ b/tools/babl-icc-rewrite.c
@@ -49,6 +49,11 @@ main (int argc,
babl = babl_space_from_icc (icc_data, icc_len, &error);
free (icc_data);
+ if (error || !babl)
+ {
+ fprintf (stderr, "%s error %s", argv[0], error);
+ return -1;
+ }
icc_data = (char *)babl_space_to_icc (babl, &genlen);
if (icc_data)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]