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

Git pushed a commit to branch master
in repository ffmpeg.

commit 25e4cde609ef3296b60da56b4ab9b641e1fd0934
Author:     Michael Niedermayer <[email protected]>
AuthorDate: Tue Oct 13 06:10:51 2026 +0200
Commit:     michaelni <[email protected]>
CommitDate: Tue Oct 20 20:41:50 2026 +0000

    avfilter/dnn_backend_openvino: free the frames when execution fails before 
the task is queued
    
    This is not a security issue.
    
    Fixes: 6HSeekmc6mV7
    Fixes: 8YwigyLd85Gn
    Fixes: 
swarm-Memory-leak-of-input-output-frames-on-ff_dnn_execute_model-failure-3a5cbe
    Fixes: memleak
    Memory leak Replicated through UnModified FFmpeg with LSan
    
    Found-by: zhang xingxing <[email protected]>
---
 libavfilter/dnn/dnn_backend_openvino.c | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/libavfilter/dnn/dnn_backend_openvino.c 
b/libavfilter/dnn/dnn_backend_openvino.c
index e2202c0da4..7ec3bb1632 100644
--- a/libavfilter/dnn/dnn_backend_openvino.c
+++ b/libavfilter/dnn/dnn_backend_openvino.c
@@ -1502,26 +1502,28 @@ static int dnn_execute_model_ov(const DNNModel *model, 
DNNExecBaseParams *exec_p
                             exec_params->output_names, exec_params->nb_output);
         if (ret != 0) {
             av_log(ctx, AV_LOG_ERROR, "Failed init OpenVINO executable network 
or inference request\n");
-            return ret;
+            goto fail;
         }
     }
 
     task = av_malloc(sizeof(*task));
     if (!task) {
         av_log(ctx, AV_LOG_ERROR, "unable to alloc memory for task item.\n");
-        return AVERROR(ENOMEM);
+        ret = AVERROR(ENOMEM);
+        goto fail;
     }
 
     ret = ff_dnn_fill_task(task, exec_params, ov_model, ctx->async, 1);
     if (ret != 0) {
         av_freep(&task);
-        return ret;
+        goto fail;
     }
 
     if (ff_queue_push_back(ov_model->task_queue, task) < 0) {
         av_freep(&task);
         av_log(ctx, AV_LOG_ERROR, "unable to push back task_queue.\n");
-        return AVERROR(ENOMEM);
+        ret = AVERROR(ENOMEM);
+        goto fail;
     }
 
     ret = extract_lltask_from_task(model->func_type, task, 
ov_model->lltask_queue, exec_params);
@@ -1566,6 +1568,10 @@ static int dnn_execute_model_ov(const DNNModel *model, 
DNNExecBaseParams *exec_p
         }
         return execute_model_ov(request, ov_model->lltask_queue);
     }
+fail:
+    av_frame_free(&exec_params->in_frame);
+    av_frame_free(&exec_params->out_frame);
+    return ret;
 }
 
 static DNNAsyncStatusType dnn_get_result_ov(const DNNModel *model, AVFrame 
**in, AVFrame **out)

-- 
To stop receiving notification emails like this one, please contact
[email protected].
_______________________________________________
ffmpeg-cvslog mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to