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

Git pushed a commit to branch master
in repository ffmpeg.

The following commit(s) were added to refs/heads/master by this push:
     new 1b98286131 swscale: unref on allocation failure in 
frame_alloc_buffers()
1b98286131 is described below

commit 1b982861315f4474a3a0253b373cecb229335fe6
Author:     Zhao Zhili <[email protected]>
AuthorDate: Mon Apr 13 21:21:42 2026 +0800
Commit:     Marvin Scholz <[email protected]>
CommitDate: Tue Apr 28 11:58:33 2026 +0000

    swscale: unref on allocation failure in frame_alloc_buffers()
    
    Signed-off-by: Zhao Zhili <[email protected]>
---
 libswscale/swscale.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/libswscale/swscale.c b/libswscale/swscale.c
index 902053aac7..f30c756e35 100644
--- a/libswscale/swscale.c
+++ b/libswscale/swscale.c
@@ -1224,8 +1224,10 @@ static int frame_alloc_buffers(SwsContext *sws, AVFrame 
*frame)
     for (int i = 0; i < nb_planes; i++) {
         frame->linesize[i] = pool->linesize[i];
         frame->buf[i] = av_buffer_pool_get(pool->pools[i]);
-        if (!frame->buf[i])
+        if (!frame->buf[i]) {
+            av_frame_unref(frame);
             return AVERROR(ENOMEM);
+        }
         frame->data[i] = frame->buf[i]->data;
     }
 

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

Reply via email to