libavfilter/vf_dnn_detect: Add NULL pointer check
Signed-off-by: Wenbin Chen <wenbin.chen@intel.com>
This commit is contained in:
parent
e01afa1c6d
commit
833722343a
@ -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;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user