[gegl] gegl: gegl-path, fix NULL dereference in malformed data



commit b5e8377a538313a355de95f74a7d5177f85e34f3
Author: Øyvind Kolås <pippin gimp org>
Date:   Sun Jun 5 17:50:37 2022 +0200

    gegl: gegl-path, fix NULL dereference in malformed data
    
    Will not occur in serializations of GEGL graphs, but can occur in
    manually provided data like when using GIMPs GEGL graph operation,
    as reported in issue #308.

 gegl/property-types/gegl-path.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/gegl/property-types/gegl-path.c b/gegl/property-types/gegl-path.c
index 922723921..ae6e8cdca 100644
--- a/gegl/property-types/gegl-path.c
+++ b/gegl/property-types/gegl-path.c
@@ -814,16 +814,16 @@ gegl_path_parse_string (GeglPath    *vector,
 
       if (!info && ((type>= '0' && type <= '9') || type == '-'))
         {
-          if (previnfo->type == 'M')
+          if (previnfo && previnfo->type == 'M')
             {
               info = lookup_instruction_info(type = 'L');
             }
-          else if (previnfo->type == 'm')
+          else if (previnfo && previnfo->type == 'm')
             {
               info = lookup_instruction_info(type = 'l');
             }
-          else if (previnfo->type == ' ')
-            g_warning ("EEEK");
+          else if (!previnfo || previnfo->type == ' ')
+            g_warning ("EEEK invalid path");
         }
 
       if (info)


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