[HarfBuzz] harfbuzz: Branch 'master' - 3 commits

Behdad Esfahbod behdad at kemper.freedesktop.org
Thu Aug 10 22:04:10 UTC 2017


 src/hb-ft.cc           |    4 ++--
 util/options.cc        |    4 ++++
 util/shape-consumer.hh |    3 ++-
 3 files changed, 8 insertions(+), 3 deletions(-)

New commits:
commit 3e44748ebe1524aef6feb01c42d342e8a2d77d34
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Wed Aug 9 22:09:01 2017 -0700

    [util] Fix two other Coverity warnings

diff --git a/util/options.cc b/util/options.cc
index 452b0ce8..f4c11119 100644
--- a/util/options.cc
+++ b/util/options.cc
@@ -240,6 +240,8 @@ parse_features (const char *name G_GNUC_UNUSED,
   } while (p);
 
   shape_opts->features = (hb_feature_t *) calloc (shape_opts->num_features, sizeof (*shape_opts->features));
+  if (!shape_opts->features)
+    return false;
 
   /* now do the actual parsing */
   p = s;
@@ -281,6 +283,8 @@ parse_variations (const char *name G_GNUC_UNUSED,
   } while (p);
 
   font_opts->variations = (hb_variation_t *) calloc (font_opts->num_variations, sizeof (*font_opts->variations));
+  if (!font_opts->variations)
+    return false;
 
   /* now do the actual parsing */
   p = s;
commit 356f93b64b6005f44bcfc329f6f9e150ec32fc26
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Wed Aug 9 22:06:53 2017 -0700

    [util] Fix warning

diff --git a/util/shape-consumer.hh b/util/shape-consumer.hh
index 78492428..cfab4497 100644
--- a/util/shape-consumer.hh
+++ b/util/shape-consumer.hh
@@ -37,7 +37,8 @@ struct shape_consumer_t
 		  : failed (false),
 		    shaper (parser),
 		    output (parser),
-		    font (NULL) {}
+		    font (NULL),
+		    buffer (NULL) {}
 
   void init (hb_buffer_t  *buffer_,
 	     const font_options_t *font_opts)
commit ac8c4e56d8b8c2e7a8f4802f83deb935bd6bbbd3
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Wed Aug 9 22:05:08 2017 -0700

    [ft] Fix theoretical leak

diff --git a/src/hb-ft.cc b/src/hb-ft.cc
index 2a1868d0..492992ee 100644
--- a/src/hb-ft.cc
+++ b/src/hb-ft.cc
@@ -632,9 +632,9 @@ hb_ft_font_create (FT_Face           ft_face,
 
 	hb_font_set_var_coords_normalized (font, coords, mm_var->num_axis);
       }
-      free (coords);
-      free (ft_coords);
     }
+    free (coords);
+    free (ft_coords);
     free (mm_var);
   }
 #endif


More information about the HarfBuzz mailing list