summaryrefslogtreecommitdiff
path: root/libavfilter/dnn
diff options
context:
space:
mode:
authorShubhanshu Saxena <shubhanshu.e01@gmail.com>2021-08-08 16:25:38 +0530
committerGuo Yejun <yejun.guo@intel.com>2021-08-10 22:27:27 +0800
commit371e5672f39284a8422574770f2505a61f73b683 (patch)
treef71964b5e3fa6b21e5496da0b652a7bf31b2839c /libavfilter/dnn
parent009b2e5b5ee602e2a27dc54077bf6fd46bdc9b9d (diff)
downloadffmpeg-371e5672f39284a8422574770f2505a61f73b683.tar.gz
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@gmail.com>
Diffstat (limited to 'libavfilter/dnn')
-rw-r--r--libavfilter/dnn/dnn_backend_tf.c3
1 files changed, 3 insertions, 0 deletions
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;