diff mbox series

[FFmpeg-devel,2/4] libavfilter/vf_dnn_detect: Add NULL pointer check

Message ID 20231214024928.230112-2-wenbin.chen@intel.com
State Accepted
Commit 833722343aa52c77893f2330d1dc06b5423da6fe
Headers show
Series [FFmpeg-devel,1/4] libavfilter/vf_dnn_detect: Fix an incorrect expression | expand

Checks

Context Check Description
yinshiyou/make_loongarch64 success Make finished
yinshiyou/make_fate_loongarch64 success Make fate finished
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

Chen, Wenbin Dec. 14, 2023, 2:49 a.m. UTC
From: Wenbin Chen <wenbin.chen@intel.com>

Signed-off-by: Wenbin Chen <wenbin.chen@intel.com>
---
 libavfilter/vf_dnn_detect.c | 4 ++++
 1 file changed, 4 insertions(+)
diff mbox series

Patch

diff --git a/libavfilter/vf_dnn_detect.c b/libavfilter/vf_dnn_detect.c
index b82916ce6d..b2e9b8d4c6 100644
--- a/libavfilter/vf_dnn_detect.c
+++ b/libavfilter/vf_dnn_detect.c
@@ -112,6 +112,10 @@  static int dnn_detect_parse_anchors(char *anchors_str, float **anchors)
     }
     for (int i = 0; i < nb_anchor; i++) {
         token = av_strtok(anchors_str, "&", &saveptr);
+        if (!token) {
+            av_freep(&anchors_buf);
+            return 0;
+        }
         anchors_buf[i] = strtof(token, NULL);
         anchors_str = NULL;
     }