From 802a270126be8b92cb7120072483c3b7cb989fe4 Mon Sep 17 00:00:00 2001 From: Thibault Saunier Date: Fri, 25 Sep 2015 14:08:09 +0200 Subject: [PATCH] smptealpha: Do not set width/height before comparing with old values Otherwise we end up considering the values did not change and we wrongly work with the old video format (which will lead to wrong behaviour/segfaults). https://bugzilla.gnome.org/show_bug.cgi?id=755621 --- gst/smpte/gstsmptealpha.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/gst/smpte/gstsmptealpha.c b/gst/smpte/gstsmptealpha.c index 38e1d6c683..06c56aece2 100644 --- a/gst/smpte/gstsmptealpha.c +++ b/gst/smpte/gstsmptealpha.c @@ -615,22 +615,20 @@ gst_smpte_alpha_set_info (GstVideoFilter * vfilter, GstCaps * incaps, { GstSMPTEAlpha *smpte = GST_SMPTE_ALPHA (vfilter); gboolean ret; - gint width, height; smpte->process = NULL; - smpte->in_format = GST_VIDEO_INFO_FORMAT (in_info); smpte->out_format = GST_VIDEO_INFO_FORMAT (out_info); - smpte->width = width = GST_VIDEO_INFO_WIDTH (out_info); - smpte->height = height = GST_VIDEO_INFO_HEIGHT (out_info); /* try to update the mask now, this will also adjust the width/height on * success */ GST_OBJECT_LOCK (smpte); ret = gst_smpte_alpha_update_mask (smpte, smpte->type, smpte->invert, - smpte->depth, width, height); + smpte->depth, GST_VIDEO_INFO_WIDTH (out_info), + GST_VIDEO_INFO_HEIGHT (out_info)); GST_OBJECT_UNLOCK (smpte); + if (!ret) goto mask_failed;