From: Tony Cook Date: Fri, 19 Jul 2013 13:30:26 +0000 (+1000) Subject: make sure T1lib anti-aliasing is properly setup for non AA text X-Git-Tag: v0.98~14 X-Git-Url: http://git.imager.perl.org/imager.git/commitdiff_plain/0d052fd9e115cc7f0cc3c2b2ef2bfaa093a63cd3 make sure T1lib anti-aliasing is properly setup for non AA text 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. --- diff --git a/Changes b/Changes index d7bfcfc5..0ee9949a 100644 --- 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 =========== diff --git a/T1/Changes b/T1/Changes index b80a75a6..25e2aead 100644 --- a/T1/Changes +++ b/T1/Changes @@ -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 ====================== diff --git a/T1/T1.pm b/T1/T1.pm index 84a66a20..c03757d7 100644 --- 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); diff --git a/T1/imt1.c b/T1/imt1.c index ef997699..42c8e50c 100644 --- 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;