]> git.imager.perl.org - imager.git/commitdiff
make sure T1lib anti-aliasing is properly setup for non AA text
authorTony Cook <tony@develop-help.com>
Fri, 19 Jul 2013 13:30:26 +0000 (23:30 +1000)
committerTony Cook <tony@develop-help.com>
Fri, 19 Jul 2013 13:30:26 +0000 (23:30 +1000)
Previously t1_aa was initialized to 0, the same as the non-AA setting,
which meant if the first text drawn was non-AA that T1 anti-aliasing
hadn't been configured.

Initialize it to -1, an invalid anti-aliasing setting so that an initial
AA setting of "none" will properly initialize.

Changes
T1/Changes
T1/T1.pm
T1/imt1.c

diff --git a/Changes b/Changes
index d7bfcfc50537aad5282e1d910ed84d9d415afc04..0ee9949aa290eee5b17b36881fd3f5b0335b964c 100644 (file)
--- a/Changes
+++ b/Changes
@@ -7,6 +7,10 @@ Imager release history.  Older releases can be found in Changes.old
    image, or possibly to a segmentation fault.
    I don't believe this has any security concerns beyond that.
 
+ - if the first text drawn with Imager::Font::T1 is not anti-aliased,
+   text drawn would be nonsense.  This would also read beyond the end
+   of a malloced buffer.
+
 Imager 0.97 - 15 Jul 2013
 ===========
 
index b80a75a64183758448cda7e44ea61473a4b18d5c..25e2aead04f37abd3c05ece54495708db0f706d5 100644 (file)
@@ -1,3 +1,10 @@
+Imager::Font::T1 1.023
+======================
+
+ - if the first text drawn with Imager::Font::T1 is not anti-aliased,
+   text drawn would be nonsense.  This would also read beyond the end
+   of a malloced buffer.
+
 Imager::Font::T1 1.022
 ======================
 
index 84a66a20f7c72e5d1a82f94502e2ae2dd0822bb3..c03757d7dc05546ee46b1418401f5d66b2f011de 100644 (file)
--- a/T1/T1.pm
+++ b/T1/T1.pm
@@ -6,7 +6,7 @@ use vars qw(@ISA $VERSION);
 use Scalar::Util ();
 
 BEGIN {
-  $VERSION = "1.022";
+  $VERSION = "1.023";
 
   require XSLoader;
   XSLoader::load('Imager::Font::T1', $VERSION);
index ef9976993fbe9c09d464567ef9474d40b0150e8d..42c8e50cf7aad666d209b483b3a660ceb3d15888 100644 (file)
--- a/T1/imt1.c
+++ b/T1/imt1.c
@@ -11,7 +11,7 @@ static void i_t1_set_aa(int st);
 
 static int t1_active_fonts = 0;
 static int t1_initialized = 0;
-static int t1_aa = 0;
+static int t1_aa = -1;
 
 struct i_t1_font_tag {
   int font_id;
@@ -211,6 +211,8 @@ i_t1_set_aa(int st) {
   int i;
   unsigned long cst[17];
 
+  mm_log((1, "i_t1_set_aa(%d)\n", st));
+
   if (t1_aa == st)
     return;