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 5ecdcd0..7b9a8b9 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 602d2f5..e5c44a2 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 c38c516..56348d5 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));
           }