X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=lib%2Fmodules%2Fswftext.c;h=3d6a49be8f9da61e988e868d9ab0f8b6758c887a;hb=7155f27b636876b1b3c2c9f39c6393b9b5ce0f8d;hp=6b13c64556c9ac32b3e7d15d2387ac7d64ce98bd;hpb=24eea9a8d3f4cccf376e3cd61ca364621e512173;p=swftools.git diff --git a/lib/modules/swftext.c b/lib/modules/swftext.c index 6b13c64..3d6a49b 100644 --- a/lib/modules/swftext.c +++ b/lib/modules/swftext.c @@ -478,7 +478,7 @@ int swf_FontReduce(SWFFONT * f,FONTUSAGE * use) j = 0; for (i=0;inumchars;i++) if (f->glyph[i].shape) - { if (f->glyph2ascii[i]numchars&& + { if (f->glyph2ascii[i]maxascii&& use->code[f->glyph2ascii[i]]) { f->ascii2glyph[f->glyph2ascii[i]] = j; f->glyph2ascii[j] = f->glyph2ascii[i]; @@ -501,8 +501,8 @@ int swf_FontReduce(SWFFONT * f,FONTUSAGE * use) int swf_FontInitUsage(SWFFONT* f, FONTUSAGE * use) { if (!use) return -1; - use->code = malloc(sizeof(use->code[0])*f->numchars); - memset(use->code,0,sizeof(use->code[0])*f->numchars); + use->code = malloc(sizeof(use->code[0])*f->maxascii); + memset(use->code,0,sizeof(use->code[0])*f->maxascii); return 0; } @@ -511,7 +511,7 @@ void swf_FontClearUsage(SWFFONT* f, FONTUSAGE * use) free(use->code); } -int swf_FontUse(FONTUSAGE * use,U8 * s) +int swf_FontUse(SWFFONT*f, FONTUSAGE * use,U8 * s) { if ((!use)||(!s)) return -1; while (s[0]) { use->code[s[0]] = 1;