[gegl] jp2-load: avoid crashing on error without gerror set



commit 26a293f00a897f7c45fbe6b0ab8805ff77f78fbe
Author: Øyvind Kolås <pippin gimp org>
Date:   Sun Mar 12 20:49:14 2017 +0100

    jp2-load: avoid crashing on error without gerror set

 operations/external/jp2-load.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)
---
diff --git a/operations/external/jp2-load.c b/operations/external/jp2-load.c
index eb2b5a6..7364c4b 100644
--- a/operations/external/jp2-load.c
+++ b/operations/external/jp2-load.c
@@ -262,8 +262,11 @@ prepare (GeglOperation *operation)
       stream = gegl_gio_open_input_stream(o->uri, o->path, &p->file, &error);
       if (stream == NULL)
         {
-          g_warning("%s", error->message);
-          g_error_free(error);
+          if (error)
+          {
+            g_warning("%s", error->message);
+            g_error_free(error);
+          }
           cleanup(operation);
           return;
         }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]