mirror of
https://git.sr.ht/~calebccff/pbsplash
synced 2026-01-12 12:38:41 -09:00
nsvgGetTextShapes: fix uninitialized values
Use calloc to zero ret, because ret[i] does not get written if NSVG_FLAGS_VISIBLE is unset. Found with valgrind.
This commit is contained in:
parent
fc5f065269
commit
a1df67dfce
1 changed files with 1 additions and 1 deletions
|
|
@ -2966,7 +2966,7 @@ static void nsvg__scaleToViewbox(NSVGparser* p, const char* units)
|
|||
NSVGshape** nsvgGetTextShapes(NSVGimage* image, char* text, int textLen)
|
||||
{
|
||||
NSVGshape *shape = NULL;
|
||||
NSVGshape **ret = malloc(sizeof(NSVGshape*)*textLen); // array of paths, text to render
|
||||
NSVGshape **ret = calloc(textLen, sizeof(shape)); // array of paths, text to render
|
||||
int i;
|
||||
|
||||
// make list of paths representing glyphs to render
|
||||
|
|
|
|||
Loading…
Reference in a new issue