aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWenbin Chen <wenbin.chen@intel.com>2023-12-14 10:49:26 +0800
committerGuo Yejun <yejun.guo@intel.com>2023-12-15 20:04:54 +0800
commit833722343aa52c77893f2330d1dc06b5423da6fe (patch)
tree1dcb357a71d6f062ffb89d9c43219b12652e84f1
parente01afa1c6d53eeae93210830968c1f0c111c1b36 (diff)
downloadffmpeg-833722343aa52c77893f2330d1dc06b5423da6fe.tar.gz
libavfilter/vf_dnn_detect: Add NULL pointer check
Signed-off-by: Wenbin Chen <wenbin.chen@intel.com>
-rw-r--r--libavfilter/vf_dnn_detect.c4
1 files changed, 4 insertions, 0 deletions
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;
}