[gegl] operations/external/raw-load: Say NO to OOM safety



commit 410fe5e420c27e5f88b39c96d39b918313409a14
Author: Debarshi Ray <debarshir gnome org>
Date:   Sat Feb 4 01:15:48 2017 +0100

    operations/external/raw-load: Say NO to OOM safety
    
    We generally don't check the return value of g_object_new, g_malloc,
    etc., and we shouldn't. See:
    http://0pointer.net/blog/projects/on-oom.html
    
    https://bugzilla.gnome.org/show_bug.cgi?id=778160

 operations/external/raw-load.c |    8 ++------
 1 files changed, 2 insertions(+), 6 deletions(-)
---
diff --git a/operations/external/raw-load.c b/operations/external/raw-load.c
index 7b40403..9e0bc9c 100644
--- a/operations/external/raw-load.c
+++ b/operations/external/raw-load.c
@@ -78,10 +78,7 @@ prepare (GeglOperation *operation)
   int         ret;
 
   if (p == NULL)
-    {
-      if ((p = g_new0(Private, 1)) == NULL)
-        g_warning ("raw-load: Error creating private structure");
-    }
+    p = g_new0(Private, 1);
 
   if (p->cached_path && !strcmp (p->cached_path, o->path))
   {
@@ -133,8 +130,7 @@ get_bounding_box (GeglOperation *operation)
       p = (Private*)o->user_data;
     }
 
-  if (p != NULL &&
-      p->LibRaw != NULL &&
+  if (p->LibRaw != NULL &&
       (p->LibRaw->progress_flags & LIBRAW_PROGRESS_IDENTIFY)) 
     {
       result.width  = p->LibRaw->sizes.width;


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