[x265] [PATCH] [MASTER] Free the Dolby Vision RPU copied into the Frame

Michael Niedermayer michael at niedermayer.cc
Sun Oct 25 04:43:39 UTC 2026


Hi

I found this while fixing a related leak in FFmpeg's libx265 wrapper.
Patch and input files attacht

cmake ../source -G Ninja -DHIGH_BIT_DEPTH=ON -DENABLE_SHARED=OFF -DENABLE_ASSEMBLY=OFF \
        -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ \
        -DCMAKE_C_FLAGS="-fsanitize=address -fno-omit-frame-pointer" \
        -DCMAKE_CXX_FLAGS="-fsanitize=address -fno-omit-frame-pointer" \
        -DCMAKE_EXE_LINKER_FLAGS="-fsanitize=address"

./x265 --input in64_10bit.yuv --input-res 64x64 --fps 25 --input-depth 10 --input-csp i420 \
         --frames 10 --preset ultrafast --bitrate 1000 --vbv-maxrate 2000 --vbv-bufsize 2000 \
         --dolby-vision-profile 5 --dolby-vision-rpu rpu10.bin -o out.hevc

=================================================================
==25678==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 90 byte(s) in 10 object(s) allocated from:
    #0 0x5e870d746b71 in operator new[](unsigned long) (x265_git/build/x265+0x141b71) (BuildId: 92c1b9f7ec8db167bac8d258dc34b2ac908d5b5e)
    #1 0x5e870da4534b in x265::Encoder::encode(x265_picture const*, x265_picture*) x265_git/source/encoder/encoder.cpp:1775:41
    #2 0x5e870d772f9f in x265_encoder_encode x265_git/source/encoder/api.cpp:593:31
    #3 0x5e870d7680c7 in x265::PassEncoder::threadMain() x265_git/source/abrEncApp.cpp:805:38
    #4 0x5e870d9bd730 in x265::stackAlignMain(x265::Thread*) x265_git/source/common/threading.cpp:100:15
    #5 0x5e870d9bd730 in x265::ThreadShim(void*) x265_git/source/common/threading.cpp:140:5
    #6 0x5e870d705f1c in asan_thread_start(void*) asan_interceptors.cpp.o

SUMMARY: AddressSanitizer: 90 byte(s) leaked in 10 allocation(s).


-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Those who are too smart to engage in politics are punished by being
governed by those who are dumber. -- Plato 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: in64_10bit.yuv
Type: application/octet-stream
Size: 122880 bytes
Desc: not available
URL: <http://mailman.videolan.org/pipermail/x265-devel/attachments/20261025/b3ab2ab0/attachment-0001.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: rpu10.bin
Type: application/octet-stream
Size: 130 bytes
Desc: not available
URL: <http://mailman.videolan.org/pipermail/x265-devel/attachments/20261025/b3ab2ab0/attachment-0002.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Free-the-Dolby-Vision-RPU-copied-into-the-Frame.patch
Type: text/x-patch
Size: 1570 bytes
Desc: not available
URL: <http://mailman.videolan.org/pipermail/x265-devel/attachments/20261025/b3ab2ab0/attachment-0003.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 195 bytes
Desc: not available
URL: <http://mailman.videolan.org/pipermail/x265-devel/attachments/20261025/b3ab2ab0/attachment-0001.sig>


More information about the x265-devel mailing list