Commit 8dc4af2bbb for ffmpeg
commit 8dc4af2bbbd0d650e299a3d327bd48c775120e11
Author: Michael Niedermayer <michael@niedermayer.cc>
Date: Sat Oct 24 05:47:15 2026 +0200
avcodec/libx265: free the Dolby Vision RPU after encoding the picture
Fixes: memleak
Fixes: 3wvWUVmf56kN (AISLE-2026-0150-00168)
Memleak Replicated through UnModified FFmpeg with ASAN
Found-by: Joshua Rogers <joshua.rogers@aisle.com>
diff --git a/libavcodec/libx265.c b/libavcodec/libx265.c
index c5e6b8c150..0ec4f87f5f 100644
--- a/libavcodec/libx265.c
+++ b/libavcodec/libx265.c
@@ -878,6 +878,9 @@ static int libx265_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
for (i = 0; i < sei->numPayloads; i++)
av_free(sei->payloads[i].payload);
av_freep(&x265pic.quantOffsets);
+#if X265_BUILD >= 167
+ av_freep(&x265pic.rpu.payload);
+#endif
if (ret < 0)
return AVERROR_EXTERNAL;