Commit Graph
3 Commits
Author SHA1 Message Date
Kacper Michajłow e6255fb822 avutil/{buffer,refstruct}: annotate pooled memory for ASan and MSan
Poison the memory when it enters the pool and unpoison it when it is
handed out again or freed. Only buffers with av_buffer_default_free are
touched, since custom pool allocators may not be compatible with it.

Also mark reused memory undefined, but only where the pool never
promised zeros.

RefStruct entries with an entry free callback own allocations while
they rest in the pool, such as the AVFrame behind an AVContainerFifo
slot. LeakSanitizer does not follow pointers stored in poisoned memory
and would report those allocations as leaked while the pool is alive,
so such entries stay addressable.

Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
2026-09-24 18:08:16 +00:00
Andreas Rheinhardt c8b09fb0ac avutil/refstruct: Remove redundant check
We now require C11.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-05-22 15:12:54 +02:00
Anton Khirnov 56ba57b672 lavc/refstruct: move to lavu and make public
It is highly versatile and generally useful.
2024-12-15 14:03:47 +01:00