videomixer2: Solve segmentation fault when src caps are configured

Change function pointers to NULL while holding the lock to avoid
race conditions

https://bugzilla.gnome.org/show_bug.cgi?id=701110
This commit is contained in:
David Fernandez 2014-03-13 10:35:30 +01:00 committed by Sebastian Dröge
parent ca9cfd40dd
commit 4ed74d3ab0

View file

@ -1642,16 +1642,16 @@ gst_videomixer2_src_setcaps (GstPad * pad, GstVideoMixer2 * mix, GstCaps * caps)
GST_INFO_OBJECT (pad, "set src caps: %" GST_PTR_FORMAT, caps); GST_INFO_OBJECT (pad, "set src caps: %" GST_PTR_FORMAT, caps);
mix->blend = NULL;
mix->overlay = NULL;
mix->fill_checker = NULL;
mix->fill_color = NULL;
if (!gst_video_info_from_caps (&info, caps)) if (!gst_video_info_from_caps (&info, caps))
goto done; goto done;
GST_VIDEO_MIXER2_LOCK (mix); GST_VIDEO_MIXER2_LOCK (mix);
mix->blend = NULL;
mix->overlay = NULL;
mix->fill_checker = NULL;
mix->fill_color = NULL;
if (GST_VIDEO_INFO_FPS_N (&mix->info) != GST_VIDEO_INFO_FPS_N (&info) || if (GST_VIDEO_INFO_FPS_N (&mix->info) != GST_VIDEO_INFO_FPS_N (&info) ||
GST_VIDEO_INFO_FPS_D (&mix->info) != GST_VIDEO_INFO_FPS_D (&info)) { GST_VIDEO_INFO_FPS_D (&mix->info) != GST_VIDEO_INFO_FPS_D (&info)) {
if (mix->segment.position != -1) { if (mix->segment.position != -1) {