mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-08-17 09:35:53 +08:00
Better fix of heap buffer overflow, suggested in https://github.com/nothings/stb/issues/1296
This commit is contained in:
parent
bec8d5b31d
commit
350d062495
@ -18,5 +18,5 @@ imstb_truetype.h modification:
|
|||||||
Hot fix for open symbolic fonts on windows
|
Hot fix for open symbolic fonts on windows
|
||||||
62bdfe6f8d04b88e8bd511cd613be80c0baa7f55
|
62bdfe6f8d04b88e8bd511cd613be80c0baa7f55
|
||||||
|
|
||||||
Hot fix for prevent Heap buffer overflow on MAC
|
Hot fix for open curved fonts mainly on MAC
|
||||||
56758dcf8568d91b8a3ad50ccd4b137181ac9490
|
2148e49f75d82cb19dc6ec409fb7825296ed005c
|
||||||
|
@ -1664,7 +1664,7 @@ static int stbtt__GetGlyphShapeTT(const stbtt_fontinfo *info, int glyph_index, s
|
|||||||
n = 1+ttUSHORT(endPtsOfContours + numberOfContours*2-2);
|
n = 1+ttUSHORT(endPtsOfContours + numberOfContours*2-2);
|
||||||
|
|
||||||
m = n + 2*numberOfContours; // a loose bound on how many vertices we might need
|
m = n + 2*numberOfContours; // a loose bound on how many vertices we might need
|
||||||
vertices = (stbtt_vertex *) STBTT_malloc((m + 1) * sizeof(vertices[0]), info->userdata);
|
vertices = (stbtt_vertex *) STBTT_malloc(m * sizeof(vertices[0]), info->userdata);
|
||||||
if (vertices == 0)
|
if (vertices == 0)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
@ -1735,7 +1735,7 @@ static int stbtt__GetGlyphShapeTT(const stbtt_fontinfo *info, int glyph_index, s
|
|||||||
|
|
||||||
// now start the new one
|
// now start the new one
|
||||||
start_off = !(flags & 1);
|
start_off = !(flags & 1);
|
||||||
if (start_off) {
|
if (start_off && (i + 1) < n) {
|
||||||
// if we start off with an off-curve point, then when we need to find a point on the curve
|
// if we start off with an off-curve point, then when we need to find a point on the curve
|
||||||
// where we can start, and we need to save some state for when we wraparound.
|
// where we can start, and we need to save some state for when we wraparound.
|
||||||
scx = x;
|
scx = x;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user