[FFmpeg-devel] [FFmpeg-cvslog] avfilter/video: don't zero allocated buffers if memory poisoning is used

Martin Storsjö martin at martin.st
Tue Aug 13 10:22:12 EEST 2024


On Tue, 13 Aug 2024, James Almer wrote:

> ffmpeg | branch: master | James Almer <jamrial at gmail.com> | Sat Aug 10 21:31:16 2024 -0300| [41307ff3e9384c51d646bff7e3dcf0d554098a8f] | committer: James Almer
>
> avfilter/video: don't zero allocated buffers if memory poisoning is used
>
> Same as in avcodec/get_buffer.c
> Should help in debugging use of uninitialized memory.
>
> Signed-off-by: James Almer <jamrial at gmail.com>
>
>> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=41307ff3e9384c51d646bff7e3dcf0d554098a8f
> ---
>
> libavfilter/video.c | 12 ++++++++----
> 1 file changed, 8 insertions(+), 4 deletions(-)

This change broke a bunch of fate tests - in particular fate-vsynth3-rpza 
and most fate-filter-pixfmts-*.

The issue doesn't show up in normal builds of ffmpeg, unless building with 
--enable-memory-poisoning. And in such a build, tools like valgrind 
doesn't detect the issue right away, as the memory poisoning causes the 
buffers to be deterministically initialized to a nonzero value (but the 
fate test produces the wrong output).

// Martin



More information about the ffmpeg-devel mailing list