[FFmpeg-cvslog] lavfi/dnn_backend_tf: Error Handling for tf_create_inference_request

Shubhanshu Saxena git at videolan.org
Tue Aug 10 17:43:36 EEST 2021


ffmpeg | branch: master | Shubhanshu Saxena <shubhanshu.e01 at gmail.com> | Sun Aug  8 16:43:38 2021 +0530| [371e5672f39284a8422574770f2505a61f73b683] | committer: Guo Yejun

lavfi/dnn_backend_tf: Error Handling for tf_create_inference_request

This commit includes the check for the case when the newly created
TFInferRequest is NULL.

Signed-off-by: Shubhanshu Saxena <shubhanshu.e01 at gmail.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=371e5672f39284a8422574770f2505a61f73b683
---

 libavfilter/dnn/dnn_backend_tf.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/libavfilter/dnn/dnn_backend_tf.c b/libavfilter/dnn/dnn_backend_tf.c
index 3dfadf888a..fb3f6f5ea6 100644
--- a/libavfilter/dnn/dnn_backend_tf.c
+++ b/libavfilter/dnn/dnn_backend_tf.c
@@ -135,6 +135,9 @@ static void tf_free_request(TFInferRequest *request)
 static TFInferRequest *tf_create_inference_request(void)
 {
     TFInferRequest *infer_request = av_malloc(sizeof(TFInferRequest));
+    if (!infer_request) {
+        return NULL;
+    }
     infer_request->tf_outputs = NULL;
     infer_request->tf_input = NULL;
     infer_request->input_tensor = NULL;



More information about the ffmpeg-cvslog mailing list