[gegl] jpg-load: Fix abort on computing without valid path/uri



commit ed8b05f96a29de84c86bec9d5879323921692e1d
Author: Jon Nordby <jononor gmail com>
Date:   Mon Nov 10 06:55:49 2014 +0100

    jpg-load: Fix abort on computing without valid path/uri

 operations/external/jpg-load.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
---
diff --git a/operations/external/jpg-load.c b/operations/external/jpg-load.c
index fd2737e..f8f95b4 100644
--- a/operations/external/jpg-load.c
+++ b/operations/external/jpg-load.c
@@ -286,6 +286,8 @@ gegl_jpg_load_get_bounding_box (GeglOperation *operation)
   GFile *file = NULL;
   GError *err = NULL;
   GInputStream *stream = gegl_gio_open_input_stream(o->uri, o->path, &file, &err);
+  if (!stream)
+    return;
   const gint status = gegl_jpg_load_query_jpg (stream, &width, &height, &format);
 
   if (format)
@@ -308,6 +310,8 @@ gegl_jpg_load_process (GeglOperation       *operation,
   GFile *file = NULL;
   GError *err = NULL;
   GInputStream *stream = gegl_gio_open_input_stream(o->uri, o->path, &file, &err);
+  if (!stream)
+    return;
   const gint status = gegl_jpg_load_buffer_import_jpg(output, stream, 0, 0);
   if (err)
     {


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