Quellcode durchsuchen

stb_truetype: fix wrong result returned by stbtt_GetFontOffsetForIndex

fixed the typo in stbtt_GetFontOffsetForIndex, where the field size should be 4 instead of 14.
Giumo X. Clanjor (哆啦比猫/兰威举) vor 10 Jahren
Ursprung
Commit
3159971d85
1 geänderte Dateien mit 1 neuen und 1 gelöschten Zeilen
  1. 1 1
      stb_truetype.h

+ 1 - 1
stb_truetype.h

@@ -952,7 +952,7 @@ int stbtt_GetFontOffsetForIndex(const unsigned char *font_collection, int index)
          stbtt_int32 n = ttLONG(font_collection+8);
          stbtt_int32 n = ttLONG(font_collection+8);
          if (index >= n)
          if (index >= n)
             return -1;
             return -1;
-         return ttULONG(font_collection+12+index*14);
+         return ttULONG(font_collection+12+index*4);
       }
       }
    }
    }
    return -1;
    return -1;