Product: stb_truetype.h (nothings/stb) Version: <= 1.26
A heap buffer overflow (out-of-bounds read) in stbtt_InitFont_internal(). The function ttUSHORT() reads 2 bytes from font data without validating the offset is within buffer bounds. Triggered when parsing cmap table entries from a crafted font.
ERROR: AddressSanitizer: heap-buffer-overflow on address 0x612000000144
READ of size 1 at 0x612000000144
#0 ttUSHORT stb_truetype.h:1286
#1 stbtt_InitFont_internal stb_truetype.h:1472
#2 stbtt_InitFont stb_truetype.h:4956
0x612000000144 is located 0 bytes to the right of 260-byte region
# Decode PoC
base64 -d poc.ttf.b64 > poc.ttf
# Build and run
clang -fsanitize=address -g -O0 repro.c -o repro -lm
./repro poc.ttf