ref: 649c34f2847404575f2508585ff29bb47e3d40e2
parent: a51c4225b81b7d8b9c75013a51ff35ea0ea6fefe
author: Sigrid Solveig Haflínudóttir <sigrid@ftrv.se>
date: Mon Nov 4 21:12:50 EST 2024
sixel: do not allocate anything in init besides sixel-output type
--- a/sixel.c
+++ b/sixel.c
@@ -56,6 +56,8 @@
lerrorf(ArgError, "invalid number of colors: %d", numcolors);
value_t v = cvalue(fsotype, sizeof(fso_t));
fso_t *f = value2c(fso_t*, v);
+ if(salloc == nil)
+ sixel_allocator_new(&salloc, malloc, calloc, realloc, free);
SIXELSTATUS r = sixel_output_new(&f->out, fso_write, f, salloc);
if(SIXEL_FAILED(r))
lerrorf(IOError, "could not create sixel output");
@@ -255,5 +257,4 @@
{
fsosym = symbol("sixel-output");
fsotype = define_opaque_type(fsosym, sizeof(fso_t), &fso_vtable, nil);
- sixel_allocator_new(&salloc, malloc, calloc, realloc, free);
}