faceblur: Check CvHaarClassifierCascade is release before being modified.
authorVanessa Chipirrás Navalón <vchipirras6@gmail.com>
Wed, 26 Aug 2015 10:47:58 +0000 (12:47 +0200)
committerLuis de Bethencourt <luis@debethencourt.com>
Fri, 28 Aug 2015 11:26:45 +0000 (12:26 +0100)
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

ext/opencv/gstfaceblur.cpp

index 6c9728c..f3b6bb2 100644 (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;