libavfilter/vf_dnn_detect: Add NULL pointer check

Signed-off-by: Wenbin Chen <wenbin.chen@intel.com>
This commit is contained in:
Wenbin Chen 2023-12-14 10:49:26 +08:00 committed by Guo Yejun
parent e01afa1c6d
commit 833722343a
1 changed files with 4 additions and 0 deletions

View File

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