[gimp] app: in abr_rle_decode(), avoid freeing NULL scratch buffers



commit 782e209a33fe4a2ec2990258080211104cb42649
Author: Ell <ell_se yahoo com>
Date:   Tue Feb 11 17:57:16 2020 +0200

    app: in abr_rle_decode(), avoid freeing NULL scratch buffers
    
    ... gegl_scratch_free() doesn't generally accept NULL pointers.

 app/core/gimpbrush-load.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/app/core/gimpbrush-load.c b/app/core/gimpbrush-load.c
index f699c080be..8fa0f494ba 100644
--- a/app/core/gimpbrush-load.c
+++ b/app/core/gimpbrush-load.c
@@ -1193,16 +1193,16 @@ abr_rle_decode (GDataInputStream  *input,
             }
         }
 
-      gegl_scratch_free (cdata);
+      g_clear_pointer (&cdata, gegl_scratch_free);
     }
 
-  gegl_scratch_free (cscanline_len);
+  g_clear_pointer (&cscanline_len, gegl_scratch_free);
 
   return TRUE;
 
 err:
-  gegl_scratch_free (cdata);
-  gegl_scratch_free (cscanline_len);
+  g_clear_pointer (&cdata, gegl_scratch_free);
+  g_clear_pointer (&cscanline_len, gegl_scratch_free);
   if (error && ! *error)
     {
       g_set_error (error, GIMP_DATA_ERROR, GIMP_DATA_ERROR_READ,


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