* [FFmpeg-devel] [PATCH 1/3] lavfi/dnn: fix corruption when TF backend infer failed
@ 2023-03-16 3:00 Ting Fu
2023-03-16 3:00 ` [FFmpeg-devel] [PATCH 2/3] lavfi/dnn: fix mem leak in TF backend error handle Ting Fu
` (2 more replies)
0 siblings, 3 replies; 8+ messages in thread
From: Ting Fu @ 2023-03-16 3:00 UTC (permalink / raw)
To: ffmpeg-devel
Signed-off-by: Ting Fu <ting.fu@intel.com>
---
libavfilter/dnn/dnn_backend_tf.c | 13 ++++++++-----
1 file changed, 8 insertions(+), 5 deletions(-)
diff --git a/libavfilter/dnn/dnn_backend_tf.c b/libavfilter/dnn/dnn_backend_tf.c
index 3b5084b67b..fb1a5f1350 100644
--- a/libavfilter/dnn/dnn_backend_tf.c
+++ b/libavfilter/dnn/dnn_backend_tf.c
@@ -176,9 +176,6 @@ static int tf_start_inference(void *args)
if (TF_GetCode(request->status) != TF_OK) {
av_log(&tf_model->ctx, AV_LOG_ERROR, "%s", TF_Message(request->status));
tf_free_request(infer_request);
- if (ff_safe_queue_push_back(tf_model->request_queue, request) < 0) {
- destroy_request_item(&request);
- }
return DNN_GENERIC_ERROR;
}
return 0;
@@ -439,7 +436,9 @@ static int load_tf_model(TFModel *tf_model, const char *model_filename)
TF_DeleteBuffer(graph_def);
if (TF_GetCode(tf_model->status) != TF_OK){
TF_DeleteGraph(tf_model->graph);
+ tf_model->graph = NULL;
TF_DeleteStatus(tf_model->status);
+ tf_model->status = NULL;
av_log(ctx, AV_LOG_ERROR, "Failed to import serialized graph to model graph\n");
av_freep(&sess_config);
return DNN_GENERIC_ERROR;
@@ -453,7 +452,7 @@ static int load_tf_model(TFModel *tf_model, const char *model_filename)
av_freep(&sess_config);
if (TF_GetCode(tf_model->status) != TF_OK) {
TF_DeleteGraph(tf_model->graph);
- TF_DeleteStatus(tf_model->status);
+ tf_model->graph = NULL;
TF_DeleteSessionOptions(sess_opts);
av_log(ctx, AV_LOG_ERROR, "Failed to set config for sess options with %s\n",
tf_model->ctx.options.sess_config);
@@ -466,7 +465,7 @@ static int load_tf_model(TFModel *tf_model, const char *model_filename)
if (TF_GetCode(tf_model->status) != TF_OK)
{
TF_DeleteGraph(tf_model->graph);
- TF_DeleteStatus(tf_model->status);
+ tf_model->graph = NULL;
av_log(ctx, AV_LOG_ERROR, "Failed to create new session with model graph\n");
return DNN_GENERIC_ERROR;
}
@@ -480,8 +479,11 @@ static int load_tf_model(TFModel *tf_model, const char *model_filename)
if (TF_GetCode(tf_model->status) != TF_OK)
{
TF_DeleteSession(tf_model->session, tf_model->status);
+ tf_model->session = NULL;
TF_DeleteGraph(tf_model->graph);
+ tf_model->graph = NULL;
TF_DeleteStatus(tf_model->status);
+ tf_model->status = NULL;
av_log(ctx, AV_LOG_ERROR, "Failed to run session when initializing\n");
return DNN_GENERIC_ERROR;
}
@@ -940,6 +942,7 @@ DNNModel *ff_dnn_load_model_tf(const char *model_filename, DNNFunctionType func_
return model;
err:
+ model->model = tf_model;
ff_dnn_free_model_tf(&model);
return NULL;
}
--
2.25.1
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 8+ messages in thread
* [FFmpeg-devel] [PATCH 2/3] lavfi/dnn: fix mem leak in TF backend error handle
2023-03-16 3:00 [FFmpeg-devel] [PATCH 1/3] lavfi/dnn: fix corruption when TF backend infer failed Ting Fu
@ 2023-03-16 3:00 ` Ting Fu
2023-03-24 3:48 ` Guo, Yejun
2023-03-16 3:00 ` [FFmpeg-devel] [PATCH 3/3] lavfi/dnn: add error info for TF backend filling task failure Ting Fu
2023-03-24 3:33 ` [FFmpeg-devel] [PATCH 1/3] lavfi/dnn: fix corruption when TF backend infer failed Guo, Yejun
2 siblings, 1 reply; 8+ messages in thread
From: Ting Fu @ 2023-03-16 3:00 UTC (permalink / raw)
To: ffmpeg-devel
Signed-off-by: Ting Fu <ting.fu@intel.com>
---
libavfilter/dnn/dnn_backend_tf.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/libavfilter/dnn/dnn_backend_tf.c b/libavfilter/dnn/dnn_backend_tf.c
index fb1a5f1350..5d809a8694 100644
--- a/libavfilter/dnn/dnn_backend_tf.c
+++ b/libavfilter/dnn/dnn_backend_tf.c
@@ -176,6 +176,7 @@ static int tf_start_inference(void *args)
if (TF_GetCode(request->status) != TF_OK) {
av_log(&tf_model->ctx, AV_LOG_ERROR, "%s", TF_Message(request->status));
tf_free_request(infer_request);
+ av_freep(&request);
return DNN_GENERIC_ERROR;
}
return 0;
@@ -466,6 +467,7 @@ static int load_tf_model(TFModel *tf_model, const char *model_filename)
{
TF_DeleteGraph(tf_model->graph);
tf_model->graph = NULL;
+ av_freep(&sess_config);
av_log(ctx, AV_LOG_ERROR, "Failed to create new session with model graph\n");
return DNN_GENERIC_ERROR;
}
@@ -484,6 +486,7 @@ static int load_tf_model(TFModel *tf_model, const char *model_filename)
tf_model->graph = NULL;
TF_DeleteStatus(tf_model->status);
tf_model->status = NULL;
+ av_freep(&sess_config);
av_log(ctx, AV_LOG_ERROR, "Failed to run session when initializing\n");
return DNN_GENERIC_ERROR;
}
@@ -1177,12 +1180,14 @@ int ff_dnn_execute_model_tf(const DNNModel *model, DNNExecBaseParams *exec_param
ret = extract_lltask_from_task(task, tf_model->lltask_queue);
if (ret != 0) {
+ av_freep(&task);
av_log(ctx, AV_LOG_ERROR, "unable to extract last level task from task.\n");
return ret;
}
request = ff_safe_queue_pop_front(tf_model->request_queue);
if (!request) {
+ av_freep(&task);
av_log(ctx, AV_LOG_ERROR, "unable to get infer request.\n");
return AVERROR(EINVAL);
}
--
2.25.1
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 8+ messages in thread
* [FFmpeg-devel] [PATCH 3/3] lavfi/dnn: add error info for TF backend filling task failure
2023-03-16 3:00 [FFmpeg-devel] [PATCH 1/3] lavfi/dnn: fix corruption when TF backend infer failed Ting Fu
2023-03-16 3:00 ` [FFmpeg-devel] [PATCH 2/3] lavfi/dnn: fix mem leak in TF backend error handle Ting Fu
@ 2023-03-16 3:00 ` Ting Fu
2023-03-24 3:50 ` Guo, Yejun
2023-03-24 3:33 ` [FFmpeg-devel] [PATCH 1/3] lavfi/dnn: fix corruption when TF backend infer failed Guo, Yejun
2 siblings, 1 reply; 8+ messages in thread
From: Ting Fu @ 2023-03-16 3:00 UTC (permalink / raw)
To: ffmpeg-devel
Signed-off-by: Ting Fu <ting.fu@intel.com>
---
libavfilter/dnn/dnn_backend_tf.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/libavfilter/dnn/dnn_backend_tf.c b/libavfilter/dnn/dnn_backend_tf.c
index 5d809a8694..bafd802abf 100644
--- a/libavfilter/dnn/dnn_backend_tf.c
+++ b/libavfilter/dnn/dnn_backend_tf.c
@@ -1168,6 +1168,7 @@ int ff_dnn_execute_model_tf(const DNNModel *model, DNNExecBaseParams *exec_param
ret = ff_dnn_fill_task(task, exec_params, tf_model, ctx->options.async, 1);
if (ret != 0) {
+ av_log(ctx, AV_LOG_ERROR, "Fill task with invalid parameter(s).\n");
av_freep(&task);
return ret;
}
--
2.25.1
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [FFmpeg-devel] [PATCH 1/3] lavfi/dnn: fix corruption when TF backend infer failed
2023-03-16 3:00 [FFmpeg-devel] [PATCH 1/3] lavfi/dnn: fix corruption when TF backend infer failed Ting Fu
2023-03-16 3:00 ` [FFmpeg-devel] [PATCH 2/3] lavfi/dnn: fix mem leak in TF backend error handle Ting Fu
2023-03-16 3:00 ` [FFmpeg-devel] [PATCH 3/3] lavfi/dnn: add error info for TF backend filling task failure Ting Fu
@ 2023-03-24 3:33 ` Guo, Yejun
2023-03-24 7:49 ` Fu, Ting
2 siblings, 1 reply; 8+ messages in thread
From: Guo, Yejun @ 2023-03-24 3:33 UTC (permalink / raw)
To: FFmpeg development discussions and patches
> -----Original Message-----
> From: ffmpeg-devel <ffmpeg-devel-bounces@ffmpeg.org> On Behalf Of Ting
> Fu
> Sent: Thursday, March 16, 2023 11:00 AM
> To: ffmpeg-devel@ffmpeg.org
> Subject: [FFmpeg-devel] [PATCH 1/3] lavfi/dnn: fix corruption when TF
> backend infer failed
>
> Signed-off-by: Ting Fu <ting.fu@intel.com>
> ---
> libavfilter/dnn/dnn_backend_tf.c | 13 ++++++++-----
> 1 file changed, 8 insertions(+), 5 deletions(-)
>
> diff --git a/libavfilter/dnn/dnn_backend_tf.c
> b/libavfilter/dnn/dnn_backend_tf.c
> index 3b5084b67b..fb1a5f1350 100644
> --- a/libavfilter/dnn/dnn_backend_tf.c
> +++ b/libavfilter/dnn/dnn_backend_tf.c
> @@ -176,9 +176,6 @@ static int tf_start_inference(void *args)
> if (TF_GetCode(request->status) != TF_OK) {
> av_log(&tf_model->ctx, AV_LOG_ERROR, "%s", TF_Message(request-
> >status));
> tf_free_request(infer_request);
Please also delete this line since it is handled in execute_model_tf which
handles the error case.
> - if (ff_safe_queue_push_back(tf_model->request_queue, request) < 0) {
> - destroy_request_item(&request);
> - }
> return DNN_GENERIC_ERROR;
> }
> return 0;
> @@ -439,7 +436,9 @@ static int load_tf_model(TFModel *tf_model, const
> char *model_filename)
> TF_DeleteBuffer(graph_def);
> if (TF_GetCode(tf_model->status) != TF_OK){
> TF_DeleteGraph(tf_model->graph);
> + tf_model->graph = NULL;
> TF_DeleteStatus(tf_model->status);
> + tf_model->status = NULL;
> av_log(ctx, AV_LOG_ERROR, "Failed to import serialized graph to model
> graph\n");
> av_freep(&sess_config);
> return DNN_GENERIC_ERROR;
> @@ -453,7 +452,7 @@ static int load_tf_model(TFModel *tf_model, const
> char *model_filename)
> av_freep(&sess_config);
> if (TF_GetCode(tf_model->status) != TF_OK) {
> TF_DeleteGraph(tf_model->graph);
Please also delete this line since ff_dnn_free_model_tf handles the error case.
> - TF_DeleteStatus(tf_model->status);
> + tf_model->graph = NULL;
And this line is not needed now.
> TF_DeleteSessionOptions(sess_opts);
> av_log(ctx, AV_LOG_ERROR, "Failed to set config for sess options
> with %s\n",
> tf_model->ctx.options.sess_config);
> @@ -466,7 +465,7 @@ static int load_tf_model(TFModel *tf_model, const
> char *model_filename)
> if (TF_GetCode(tf_model->status) != TF_OK)
> {
> TF_DeleteGraph(tf_model->graph);
> - TF_DeleteStatus(tf_model->status);
> + tf_model->graph = NULL;
Same comments as above.
> av_log(ctx, AV_LOG_ERROR, "Failed to create new session with model
> graph\n");
> return DNN_GENERIC_ERROR;
> }
> @@ -480,8 +479,11 @@ static int load_tf_model(TFModel *tf_model, const
> char *model_filename)
> if (TF_GetCode(tf_model->status) != TF_OK)
> {
> TF_DeleteSession(tf_model->session, tf_model->status);
Please also delete this line since ff_dnn_free_model_tf handles the error case.
> + tf_model->session = NULL;
> TF_DeleteGraph(tf_model->graph);
> + tf_model->graph = NULL;
> TF_DeleteStatus(tf_model->status);
> + tf_model->status = NULL;
Same comments as above.
> av_log(ctx, AV_LOG_ERROR, "Failed to run session when
> initializing\n");
> return DNN_GENERIC_ERROR;
> }
> @@ -940,6 +942,7 @@ DNNModel *ff_dnn_load_model_tf(const char
> *model_filename, DNNFunctionType func_
>
> return model;
> err:
> + model->model = tf_model;
Please set model->model = tf_model when tf_model is successfully created
and also delete original line 934
> ff_dnn_free_model_tf(&model);
> return NULL;
> }
> --
> 2.25.1
>
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org
> with subject "unsubscribe".
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [FFmpeg-devel] [PATCH 2/3] lavfi/dnn: fix mem leak in TF backend error handle
2023-03-16 3:00 ` [FFmpeg-devel] [PATCH 2/3] lavfi/dnn: fix mem leak in TF backend error handle Ting Fu
@ 2023-03-24 3:48 ` Guo, Yejun
2023-03-24 7:54 ` Fu, Ting
0 siblings, 1 reply; 8+ messages in thread
From: Guo, Yejun @ 2023-03-24 3:48 UTC (permalink / raw)
To: FFmpeg development discussions and patches
> -----Original Message-----
> From: ffmpeg-devel <ffmpeg-devel-bounces@ffmpeg.org> On Behalf Of Ting
> Fu
> Sent: Thursday, March 16, 2023 11:00 AM
> To: ffmpeg-devel@ffmpeg.org
> Subject: [FFmpeg-devel] [PATCH 2/3] lavfi/dnn: fix mem leak in TF backend
> error handle
>
> Signed-off-by: Ting Fu <ting.fu@intel.com>
> ---
> libavfilter/dnn/dnn_backend_tf.c | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/libavfilter/dnn/dnn_backend_tf.c
> b/libavfilter/dnn/dnn_backend_tf.c
> index fb1a5f1350..5d809a8694 100644
> --- a/libavfilter/dnn/dnn_backend_tf.c
> +++ b/libavfilter/dnn/dnn_backend_tf.c
> @@ -176,6 +176,7 @@ static int tf_start_inference(void *args)
> if (TF_GetCode(request->status) != TF_OK) {
> av_log(&tf_model->ctx, AV_LOG_ERROR, "%s", TF_Message(request-
> >status));
> tf_free_request(infer_request);
> + av_freep(&request);
Will request be freed in the queue management code?
Others in this patch looks fine.
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [FFmpeg-devel] [PATCH 3/3] lavfi/dnn: add error info for TF backend filling task failure
2023-03-16 3:00 ` [FFmpeg-devel] [PATCH 3/3] lavfi/dnn: add error info for TF backend filling task failure Ting Fu
@ 2023-03-24 3:50 ` Guo, Yejun
0 siblings, 0 replies; 8+ messages in thread
From: Guo, Yejun @ 2023-03-24 3:50 UTC (permalink / raw)
To: FFmpeg development discussions and patches
> -----Original Message-----
> From: ffmpeg-devel <ffmpeg-devel-bounces@ffmpeg.org> On Behalf Of Ting
> Fu
> Sent: Thursday, March 16, 2023 11:00 AM
> To: ffmpeg-devel@ffmpeg.org
> Subject: [FFmpeg-devel] [PATCH 3/3] lavfi/dnn: add error info for TF backend
> filling task failure
>
> Signed-off-by: Ting Fu <ting.fu@intel.com>
> ---
> libavfilter/dnn/dnn_backend_tf.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/libavfilter/dnn/dnn_backend_tf.c
> b/libavfilter/dnn/dnn_backend_tf.c
> index 5d809a8694..bafd802abf 100644
> --- a/libavfilter/dnn/dnn_backend_tf.c
> +++ b/libavfilter/dnn/dnn_backend_tf.c
> @@ -1168,6 +1168,7 @@ int ff_dnn_execute_model_tf(const DNNModel
> *model, DNNExecBaseParams *exec_param
>
> ret = ff_dnn_fill_task(task, exec_params, tf_model, ctx->options.async, 1);
> if (ret != 0) {
> + av_log(ctx, AV_LOG_ERROR, "Fill task with invalid
> + parameter(s).\n");
> av_freep(&task);
LGTM, thanks.
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [FFmpeg-devel] [PATCH 1/3] lavfi/dnn: fix corruption when TF backend infer failed
2023-03-24 3:33 ` [FFmpeg-devel] [PATCH 1/3] lavfi/dnn: fix corruption when TF backend infer failed Guo, Yejun
@ 2023-03-24 7:49 ` Fu, Ting
0 siblings, 0 replies; 8+ messages in thread
From: Fu, Ting @ 2023-03-24 7:49 UTC (permalink / raw)
To: FFmpeg development discussions and patches
> -----Original Message-----
> From: ffmpeg-devel <ffmpeg-devel-bounces@ffmpeg.org> On Behalf Of Guo,
> Yejun
> Sent: Friday, March 24, 2023 11:34 AM
> To: FFmpeg development discussions and patches <ffmpeg-
> devel@ffmpeg.org>
> Subject: Re: [FFmpeg-devel] [PATCH 1/3] lavfi/dnn: fix corruption when TF
> backend infer failed
>
>
>
> > -----Original Message-----
> > From: ffmpeg-devel <ffmpeg-devel-bounces@ffmpeg.org> On Behalf Of
> Ting
> > Fu
> > Sent: Thursday, March 16, 2023 11:00 AM
> > To: ffmpeg-devel@ffmpeg.org
> > Subject: [FFmpeg-devel] [PATCH 1/3] lavfi/dnn: fix corruption when TF
> > backend infer failed
> >
> > Signed-off-by: Ting Fu <ting.fu@intel.com>
> > ---
> > libavfilter/dnn/dnn_backend_tf.c | 13 ++++++++-----
> > 1 file changed, 8 insertions(+), 5 deletions(-)
> >
> > diff --git a/libavfilter/dnn/dnn_backend_tf.c
> > b/libavfilter/dnn/dnn_backend_tf.c
> > index 3b5084b67b..fb1a5f1350 100644
> > --- a/libavfilter/dnn/dnn_backend_tf.c
> > +++ b/libavfilter/dnn/dnn_backend_tf.c
> > @@ -176,9 +176,6 @@ static int tf_start_inference(void *args)
> > if (TF_GetCode(request->status) != TF_OK) {
> > av_log(&tf_model->ctx, AV_LOG_ERROR, "%s",
> > TF_Message(request-
> > >status));
> > tf_free_request(infer_request);
>
> Please also delete this line since it is handled in execute_model_tf which
> handles the error case.
>
[...]
Hi Yejun,
Thank you for your review.
PATCH 1/3 was modified as comments in PATCH V2.
> > --
> > 2.25.1
> >
> > _______________________________________________
> > ffmpeg-devel mailing list
> > ffmpeg-devel@ffmpeg.org
> > https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> >
> > To unsubscribe, visit link above, or email
> > ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org
> with subject "unsubscribe".
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [FFmpeg-devel] [PATCH 2/3] lavfi/dnn: fix mem leak in TF backend error handle
2023-03-24 3:48 ` Guo, Yejun
@ 2023-03-24 7:54 ` Fu, Ting
0 siblings, 0 replies; 8+ messages in thread
From: Fu, Ting @ 2023-03-24 7:54 UTC (permalink / raw)
To: FFmpeg development discussions and patches
> -----Original Message-----
> From: ffmpeg-devel <ffmpeg-devel-bounces@ffmpeg.org> On Behalf Of Guo,
> Yejun
> Sent: Friday, March 24, 2023 11:49 AM
> To: FFmpeg development discussions and patches <ffmpeg-
> devel@ffmpeg.org>
> Subject: Re: [FFmpeg-devel] [PATCH 2/3] lavfi/dnn: fix mem leak in TF
> backend error handle
>
>
>
> > -----Original Message-----
> > From: ffmpeg-devel <ffmpeg-devel-bounces@ffmpeg.org> On Behalf Of
> Ting
> > Fu
> > Sent: Thursday, March 16, 2023 11:00 AM
> > To: ffmpeg-devel@ffmpeg.org
> > Subject: [FFmpeg-devel] [PATCH 2/3] lavfi/dnn: fix mem leak in TF
> > backend error handle
> >
> > Signed-off-by: Ting Fu <ting.fu@intel.com>
> > ---
> > libavfilter/dnn/dnn_backend_tf.c | 5 +++++
> > 1 file changed, 5 insertions(+)
> >
> > diff --git a/libavfilter/dnn/dnn_backend_tf.c
> > b/libavfilter/dnn/dnn_backend_tf.c
> > index fb1a5f1350..5d809a8694 100644
> > --- a/libavfilter/dnn/dnn_backend_tf.c
> > +++ b/libavfilter/dnn/dnn_backend_tf.c
> > @@ -176,6 +176,7 @@ static int tf_start_inference(void *args)
> > if (TF_GetCode(request->status) != TF_OK) {
> > av_log(&tf_model->ctx, AV_LOG_ERROR, "%s",
> > TF_Message(request-
> > >status));
> > tf_free_request(infer_request);
> > + av_freep(&request);
>
> Will request be freed in the queue management code?
>
> Others in this patch looks fine.
As I checked, the queue management code did not free such variables. But it was free in ff_dnn_free_model_tf function. So, I deleted this line in PATCH V2.
And added an extra code, which also help free mem in 'model' when execute model failed, in line 1130. Hope this make sense to you.
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org
> with subject "unsubscribe".
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2023-03-24 7:56 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-16 3:00 [FFmpeg-devel] [PATCH 1/3] lavfi/dnn: fix corruption when TF backend infer failed Ting Fu
2023-03-16 3:00 ` [FFmpeg-devel] [PATCH 2/3] lavfi/dnn: fix mem leak in TF backend error handle Ting Fu
2023-03-24 3:48 ` Guo, Yejun
2023-03-24 7:54 ` Fu, Ting
2023-03-16 3:00 ` [FFmpeg-devel] [PATCH 3/3] lavfi/dnn: add error info for TF backend filling task failure Ting Fu
2023-03-24 3:50 ` Guo, Yejun
2023-03-24 3:33 ` [FFmpeg-devel] [PATCH 1/3] lavfi/dnn: fix corruption when TF backend infer failed Guo, Yejun
2023-03-24 7:49 ` Fu, Ting
Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
This inbox may be cloned and mirrored by anyone:
git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git
# If you have public-inbox 1.1+ installed, you may
# initialize and index your mirror using the following commands:
public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
ffmpegdev@gitmailbox.com
public-inbox-index ffmpegdev
Example config snippet for mirrors.
AGPL code for this site: git clone https://public-inbox.org/public-inbox.git