[gegl] operations: fix a bunch of uninitialized memory errors found by valgrind



commit be3880d8fd4ce783a45eda3ee5126330640570b8
Author: Michael Natterer <mitch gimp org>
Date:   Wed Dec 4 22:59:35 2013 +0100

    operations: fix a bunch of uninitialized memory errors found by valgrind

 operations/common/channel-mixer.c |    2 +-
 operations/common/svg-huerotate.c |    8 ++++----
 operations/common/svg-saturate.c  |    8 ++++----
 3 files changed, 9 insertions(+), 9 deletions(-)
---
diff --git a/operations/common/channel-mixer.c b/operations/common/channel-mixer.c
index ed478dc..cfa7858 100644
--- a/operations/common/channel-mixer.c
+++ b/operations/common/channel-mixer.c
@@ -118,7 +118,7 @@ static void prepare (GeglOperation *operation)
   const Babl *format;
 
   if (o->chant_data == NULL)
-    o->chant_data = g_slice_new (CmParamsType);
+    o->chant_data = g_slice_new0 (CmParamsType);
 
   mix = (CmParamsType*) o->chant_data;
 
diff --git a/operations/common/svg-huerotate.c b/operations/common/svg-huerotate.c
index 3e4067d..258a2b9 100644
--- a/operations/common/svg-huerotate.c
+++ b/operations/common/svg-huerotate.c
@@ -63,8 +63,8 @@ process (GeglOperation       *op,
                     0.0, 0.0, 0.0, 0.0, 1.0};
   char        *endptr;
   gfloat       value;
-  const gchar  delimiter=',';
-  const gchar *delimiters=" ";
+  const gchar *delimiter = ",";
+  const gchar *delimiters = " ";
   gchar      **values;
   glong        i;
 
@@ -73,8 +73,8 @@ process (GeglOperation       *op,
   if ( o->values != NULL )
     {
       g_strstrip(o->values);
-      g_strdelimit (o->values, delimiters, delimiter);
-      values = g_strsplit (o->values, &delimiter, 1);
+      g_strdelimit (o->values, delimiters, *delimiter);
+      values = g_strsplit (o->values, delimiter, 1);
       if ( values[0] != NULL )
         {
           value = g_ascii_strtod(values[0], &endptr);
diff --git a/operations/common/svg-saturate.c b/operations/common/svg-saturate.c
index 9c79abc..071b89e 100644
--- a/operations/common/svg-saturate.c
+++ b/operations/common/svg-saturate.c
@@ -63,8 +63,8 @@ process (GeglOperation       *op,
                     0.0, 0.0, 0.0, 0.0, 1.0};
   char         *endptr;
   gfloat        value;
-  const gchar   delimiter=',';
-  const gchar  *delimiters=" ";
+  const gchar  *delimiter = ",";
+  const gchar  *delimiters = " ";
   gchar       **values;
   glong         i;
 
@@ -73,8 +73,8 @@ process (GeglOperation       *op,
   if ( o->values != NULL )
     {
       g_strstrip(o->values);
-      g_strdelimit (o->values, delimiters, delimiter);
-      values = g_strsplit (o->values, &delimiter, 1);
+      g_strdelimit (o->values, delimiters, *delimiter);
+      values = g_strsplit (o->values, delimiter, 1);
       if (values[0] != NULL)
         {
           value = g_ascii_strtod(values[0], &endptr);


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