Commit 1ca5fa15b0a96360d73a4d114c2d3667aae898ba

Werner Lemberg 2014-10-12T08:31:32

[sfnt] Fix Savannah bug #43392. * src/sfnt/ttsbit.c (tt_sbit_decoder_load_metrics): Don't let vertical metrics uninitialized.

diff --git a/ChangeLog b/ChangeLog
index f7f4b0f..6ca3524 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2014-10-12  Werner Lemberg  <wl@gnu.org>
+
+	[sfnt] Fix Savannah bug #43392.
+
+	* src/sfnt/ttsbit.c (tt_sbit_decoder_load_metrics): Don't let
+	vertical metrics uninitialized.
+
 2014-10-11  Alexei Podtelezhnikov  <apodtele@gmail.com>
 
 	[base] Small bbox correction.
diff --git a/src/sfnt/ttsbit.c b/src/sfnt/ttsbit.c
index 180d559..8899a03 100644
--- a/src/sfnt/ttsbit.c
+++ b/src/sfnt/ttsbit.c
@@ -505,6 +505,13 @@
 
       p += 3;
     }
+    else
+    {
+      /* avoid uninitialized data in case there is no vertical info -- */
+      metrics->vertBearingX = 0;
+      metrics->vertBearingY = 0;
+      metrics->vertAdvance  = metrics->width;
+    }
 
     decoder->metrics_loaded = 1;
     *pp = p;