mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-18 07:47:17 +00:00
facedetect: fix profile loading check
Since the profile gchar depends on DEFAULT_FACE_PROFILE, it should never be NULL. Furthermore CascadeClassifier accepts any input, even an empty one, but if the profile fails to load it returns an empty cascade. Check for this instead, and inform the user if there was an Error.
This commit is contained in:
parent
bc33d22635
commit
3a765e0805
1 changed files with 6 additions and 3 deletions
|
@ -801,10 +801,13 @@ gst_face_detect_load_profile (GstFaceDetect * filter, gchar * profile)
|
|||
{
|
||||
CascadeClassifier *cascade;
|
||||
|
||||
if (profile == NULL)
|
||||
return NULL;
|
||||
|
||||
cascade = new CascadeClassifier (profile);
|
||||
if (cascade->empty ()) {
|
||||
GST_ERROR_OBJECT (filter, "Invalid profile file: %s", profile);
|
||||
delete (cascade);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return cascade;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue