faceblur: Check CvHaarClassifierCascade is release before being modified.

For PROP_PROFILE case that exist inside gst_face_blur_set_property
function loads the new XML file in the CvHaarClassifierCascade property
without first checking that it is released because maybe there is an XML
file previously loaded.

https://bugzilla.gnome.org/show_bug.cgi?id=753994
This commit is contained in:
Vanessa Chipirrás Navalón 2015-08-26 12:47:58 +02:00 committed by Luis de Bethencourt
parent bbd16144ca
commit acdcfedde2

View file

@ -265,6 +265,8 @@ gst_face_blur_set_property (GObject * object, guint prop_id,
switch (prop_id) {
case PROP_PROFILE:
g_free (filter->profile);
if (filter->cvCascade)
cvReleaseHaarClassifierCascade (&filter->cvCascade);
filter->profile = g_value_dup_string (value);
filter->cvCascade = gst_face_blur_load_profile (filter, filter->profile);
filter->sent_profile_load_failed_msg = FALSE;