This is an automated email from the git hooks/post-receive script.

Git pushed a commit to branch master
in repository ffmpeg.

commit 3b0409dd13508a27e8758088ae8023fcec20ed44
Author:     0xBat <[email protected]>
AuthorDate: Mon Jan 5 02:11:44 2026 +0100
Commit:     Michael Niedermayer <[email protected]>
CommitDate: Fri Jan 9 23:44:58 2026 +0100

    doc/examples/hw_decode: fix memory leak in codec context initialization
    
    Properly free decoder_ctx on failure to prevent a memory leak during 
initialization.
    
    Signed-off-by: 0xBat <[email protected]>
    Signed-off-by: Michael Niedermayer <[email protected]>
---
 doc/examples/hw_decode.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/doc/examples/hw_decode.c b/doc/examples/hw_decode.c
index ac4e445505..ce18814760 100644
--- a/doc/examples/hw_decode.c
+++ b/doc/examples/hw_decode.c
@@ -215,8 +215,10 @@ int main(int argc, char *argv[])
         return AVERROR(ENOMEM);
 
     video = input_ctx->streams[video_stream];
-    if (avcodec_parameters_to_context(decoder_ctx, video->codecpar) < 0)
+    if (avcodec_parameters_to_context(decoder_ctx, video->codecpar) < 0) {
+        avcodec_free_context(&decoder_ctx);
         return -1;
+    }
 
     decoder_ctx->get_format  = get_hw_format;
 

_______________________________________________
ffmpeg-cvslog mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to