allocate the correct number of stack entries for glyph_names()
authorTony Cook <tony@develop-help.com>
Fri, 1 Mar 2013 12:08:01 +0000 (23:08 +1100)
committerTony Cook <tony@develop-help.com>
Fri, 1 Mar 2013 12:08:01 +0000 (23:08 +1100)
Each of the drivers allocated count entries then attempted to use entry
"count".  Allocate count+1 entries instead

FT2/FT2.xs
Imager.xs
T1/T1.xs

index 5ecdcd0583d5a6ce35efbc3a62888e641ea6b93d..7b9a8b9f72427122e61d3eb6707dfa62ee9b41c3 100644 (file)
@@ -303,7 +303,7 @@ i_ft2_glyph_name(handle, text_sv, utf8 = 0, reliable_only = 1)
             ch = *text++;
             --len;
           }
-          EXTEND(SP, count);
+          EXTEND(SP, count+1);
           if (i_ft2_glyph_name(handle, ch, name, sizeof(name), 
                                          reliable_only)) {
             ST(count) = sv_2mortal(newSVpv(name, 0));
index 602d2f526d8c755cfb06e67a5f1757846a4e4fcd..e5c44a21c6e681eef09be75eba231f820ff54c7f 100644 (file)
--- a/Imager.xs
+++ b/Imager.xs
@@ -2395,7 +2395,7 @@ i_tt_glyph_name(handle, text_sv, utf8 = 0)
             ch = *text++;
             --len;
           }
-          EXTEND(SP, count);
+          EXTEND(SP, count+1);
           if ((outsize = i_tt_glyph_name(handle, ch, name, sizeof(name))) != 0) {
            ST(count) = sv_2mortal(newSVpv(name, 0));
           }
index c38c516a528a1f60a730539481f1b5b86be189ec..56348d5c85061a6831081e51ce257574ab1f44dc 100644 (file)
--- a/T1/T1.xs
+++ b/T1/T1.xs
@@ -195,7 +195,7 @@ i_t1_glyph_names(font, text_sv, utf8 = 0)
             ch = *text++;
             --len;
           }
-          EXTEND(SP, count);
+          EXTEND(SP, count+1);
           if (i_t1_glyph_name(font, ch, name, sizeof(name))) {
             ST(count) = sv_2mortal(newSVpv(name, 0));
           }