summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVanessa Chipirrás Navalón <vchipirras6@gmail.com>2015-08-26 12:47:58 +0200
committerLuis de Bethencourt <luis@debethencourt.com>2015-08-28 12:26:45 +0100
commitacdcfedde27fc33dfc13a091228405c5526706f3 (patch)
tree448a64f928beca0f62fbc651489452d595907b8d
parentbbd16144ca4c572485a4b74f0cf10f701d867e9b (diff)
downloadgstreamer-plugins-bad-acdcfedde27fc33dfc13a091228405c5526706f3.tar.gz
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
-rw-r--r--ext/opencv/gstfaceblur.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/ext/opencv/gstfaceblur.cpp b/ext/opencv/gstfaceblur.cpp
index 6c9728cac..f3b6bb218 100644
--- a/ext/opencv/gstfaceblur.cpp
+++ b/ext/opencv/gstfaceblur.cpp
@@ -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;