Describe the bug
When running valgrind over my C application that uses stb_truetype for drawing glyphs on a buffer, I get 'invalid read of size 1' on almost all function calls I do.
Lots of them point to the same ttSHORT call, like this one:
==3427652== Invalid read of size 1
==3427652== at 0x10C453: ttSHORT (stb_truetype.h:1287)
==3427652== by 0x111A61: stbtt_ScaleForPixelHeight (stb_truetype.h:2662)
But it is certainly not limited to ttSHORT and stbtt_ScaleForPixelHeight.
Reading 1 byte too many will almost never generate a crash but it can't be good, and it is also very annoying when trying to find my own memory leaks in between.
To Reproduce
This simple test already shows several of those invalid reads in valgrind:
Describe the bug When running valgrind over my C application that uses stb_truetype for drawing glyphs on a buffer, I get 'invalid read of size 1' on almost all function calls I do. Lots of them point to the same ttSHORT call, like this one:
But it is certainly not limited to ttSHORT and stbtt_ScaleForPixelHeight.
Reading 1 byte too many will almost never generate a crash but it can't be good, and it is also very annoying when trying to find my own memory leaks in between.
To Reproduce This simple test already shows several of those invalid reads in valgrind:
I have tried with a different .ttf file with the same result, so I guess it doesn't have to do anything with the .ttf file.
No special valgrind arguments are needed.