Skip to content

Instantly share code, notes, and snippets.

@aminophen
Created February 23, 2019 09:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aminophen/bd616ddf70b44768be8def44c8cf766e to your computer and use it in GitHub Desktop.
Save aminophen/bd616ddf70b44768be8def44c8cf766e to your computer and use it in GitHub Desktop.
例の dvipdfmx の修正
--- tt_post.c.1~ Sun Jan 31 08:20:35 2016
+++ tt_post.c Sat Feb 23 18:14:31 2019
@@ -161,7 +161,7 @@
ASSERT(post && glyphname);
- for (gid = 0; gid < post->count; gid++) {
+ for (gid = 0; gid < post->numberOfGlyphs; gid++) {
if (post->glyphNamePtr[gid] &&
!strcmp(glyphname, post->glyphNamePtr[gid])) {
return gid;
@aminophen
Copy link
Author

https://gist.github.com/zr-tex8r/56b4945178ab43f0c16664d8f1edd449 のバグへの対処。

tt_post.c によると

  post->glyphNamePtr = NEW(post->numberOfGlyphs, const char *);

である。すなわち post->glyphNamePtrpost->numberOfGlyphs のサイズしかメモリ確保していない。

ところが,ipaexm.ttf では post->numberOfGlyphs = 12238 である一方 post->count = 12250 であり,この場合ループが回りすぎてしまい,落ちていたらしい。

@aminophen
Copy link
Author

texjporg/tex-jp-build#74 にファイルし,r50098 でコミットしました。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment