[FFmpeg-cvslog] libavfilter/vf_dnn_detect: Add NULL pointer check

Wenbin Chen git at videolan.org
Fri Dec 15 14:44:02 EET 2023


ffmpeg | branch: master | Wenbin Chen <wenbin.chen at intel.com> | Thu Dec 14 10:49:26 2023 +0800| [833722343aa52c77893f2330d1dc06b5423da6fe] | committer: Guo Yejun

libavfilter/vf_dnn_detect: Add NULL pointer check

Signed-off-by: Wenbin Chen <wenbin.chen at intel.com>

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

 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;
     }



More information about the ffmpeg-cvslog mailing list