stb_truetype: fix warning
Before adoption: this commit came in with the history the project adopted, so no landing records it.
authored by Sean Barrett · committed by Sean Barrett · parent 37b9b20 · Browse files · 1 file·+23 added−13 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
1 file+23 added−13 removed
- other:+23 added−13 removed
Provenance
- Commit
cd74294- Tree
950f9b9- Author
Sean Barrett <sean@nothings.org>- Committer
Sean Barrett <sean@nothings.org>- Parent
37b9b20
1 file changed+23 added−13 removed
modified:stb_truetype.h+23 added-13 removed
1-// stb_truetype.h - v1.23 - public domain2-// authored from 2009-2019 by Sean Barrett / RAD Game Tools1+// stb_truetype.h - v1.24 - public domain2+// authored from 2009-2020 by Sean Barrett / RAD Game Tools3 //4+// =======================================================================5+//6+// NO SECURITY GUARANTEE -- DO NOT USE THIS ON UNTRUSTED FONT FILES7+//8+// This library does no range checking of the offsets found in the file,9+// meaning an attacker can use it to read arbitrary memory.10+//11+// =======================================================================12+//13 // This library processes TrueType files:14 // parse files15 // extract glyph metrics16 // extract glyph shapes23 unmodified lines40 // Imanol Celaya41 // Daniel Ribeiro Maciel42 //43 // Bug/warning reports/fixes:35-// "Zer" on mollyrocket Fabian "ryg" Giesen36-// Cass Everitt Martins Mozeiko37-// stoiko (Haemimont Games) Cap Petschulat38-// Brian Hook Omar Cornut39-// Walter van Niftrik github:aloucks44+// "Zer" on mollyrocket Fabian "ryg" Giesen github:NiLuJe45+// Cass Everitt Martins Mozeiko github:aloucks46+// stoiko (Haemimont Games) Cap Petschulat github:oyvindjam47+// Brian Hook Omar Cornut github:vassvik48+// Walter van Niftrik Ryan Griege49 // David Gow Peter LaValle50 // David Given Sergey Popov51 // Ivan-Assen Ivanov Giumo X. Clanjor52 // Anthony Pesch Higor Euripedes53 // Johan Duparc Thomas Fields54 // Hou Qiming Derek Vinyard55 // Rob Loach Cort Stratton47-// Kenney Phillis Jr. github:oyvindjam48-// Brian Costabile github:vassvik49-// Ken Voskuil (kaesve) Ryan Griege56+// Kenney Phillis Jr. Brian Costabile 57+// Ken Voskuil (kaesve) 58 //59 // VERSION HISTORY60 //61+// 1.24 (2020-02-05) fix warning62 // 1.23 (2020-02-02) query SVG data for glyphs; query whole kerning table (but only kern not GPOS)63 // 1.22 (2019-08-11) minimize missing-glyph duplication; fix kerning if both 'GPOS' and 'kern' are defined64 // 1.21 (2019-02-25) fix warning65 // 1.20 (2019-02-07) PackFontRange skips missing codepoints; GetScaleFontVMetrics()2642 unmodified lines2708 {2709 stbtt_uint8 *data = info->data;2710 stbtt_uint8 *svg_doc;2711 2703- if(info->svg == 0)2712+ if (info->svg == 0)2713 return 0;2714 2715+ svg_doc = stbtt_FindSVGDoc(info, gl);2706- if(svg_doc = stbtt_FindSVGDoc(info, gl)) {2707- *svg = (char *)data + info->svg + ttULONG(svg_doc + 4);2716+ if (svg_doc != NULL) {2717+ *svg = (char *) data + info->svg + ttULONG(svg_doc + 4);2718 return ttULONG(svg_doc + 8);2719 } else {2720 return 0;2721 }2290 unmodified lines