Fix off-by-one buffer growth in sixel_print_add and add regression test.

This commit is contained in:
Michael Grant
2026-10-09 18:38:02 +02:00
parent 554aedf09b
commit 4b13e0c3d7
4 changed files with 120 additions and 1 deletions

View File

@@ -0,0 +1,15 @@
# Use the configured compiler and flags for the standalone encoder check.
.PHONY: sixel-buffer-probe sixel-buffer-test
sixel-buffer-probe:
$(CC) $(CFLAGS) $(LDFLAGS) -fsanitize=address \
-o "$(SIXEL_TEST_DIR)/probe" "$(SIXEL_TEST_DIR)/probe.c"
sixel-buffer-test:
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -UNDEBUG \
-ffunction-sections -fdata-sections -fsanitize=address \
-fno-omit-frame-pointer $(SIXEL_TEST_LDFLAGS) $(LDFLAGS) \
-o "$(SIXEL_TEST_DIR)/test" "$(srcdir)/regress/image-sixel-buffer.c" \
"$(srcdir)/compat/reallocarray.c"