From: Wenbin Chen <wenbin.c...@intel.com>

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

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;
     }
-- 
2.34.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-requ...@ffmpeg.org with subject "unsubscribe".

Reply via email to