Commit 5c35cd56d0 for ffmpeg
commit 5c35cd56d0b41d6ee786b742b1c3cd870f434a1c
Author: Peter Krefting <peter@softwolves.pp.se>
Date: Wed Nov 18 14:49:26 2026 +0100
avformat/mov: Fix memory leak
The AES context allocated by cbc1_scheme_decrypt() or
cbcs_scheme_decrypt() was never cleaned up.
Found-by: Claude Opus 5.5
diff --git a/libavformat/mov.c b/libavformat/mov.c
index 97f26cf28b..85936bf825 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -11033,6 +11033,7 @@ static void mov_free_stream_context(AVFormatContext *s, AVStream *st)
mov_free_encryption_index(&sc->cenc.encryption_index);
av_encryption_info_free(sc->cenc.default_encrypted_sample);
av_aes_ctr_free(sc->cenc.aes_ctr);
+ av_freep(&sc->cenc.aes_ctx);
av_freep(&sc->stereo3d);
av_freep(&sc->spherical);