Open HappySeaFox opened 1 year ago
Indeed, that is something that would be very useful for applications already having their own memory allocators. E.g. PHP uses this to be able to limit the amount of memory for a process/thread, what seems to be particularly relevant to reading of AVIF images from untrusted sources (the file might be small, but may use large amounts of memory when read).
Hi!
Some libraries like
libpng
(png_create_read_struct_2
,png_set_mem_fn
) orlibjxl
(JxlMemoryManager
) allow setting custom memory allocator that will be used by the library instead of the standard malloc/free. It would be great to have this feature in libavif.