gl/mixer: don't segfault when we don't have a buffer
authorMatthew Waters <ystreet00@gmail.com>
Tue, 27 May 2014 03:55:15 +0000 (13:55 +1000)
committerTim-Philipp Müller <tim@centricular.com>
Sat, 9 Dec 2017 19:31:41 +0000 (19:31 +0000)
https://bugzilla.gnome.org/show_bug.cgi?id=729257

gst-libs/gst/gl/gstglmixer.c

index 89b68db..ef828e0 100644 (file)
@@ -1648,6 +1648,11 @@ gst_gl_mixer_process_textures (GstGLMixer * mix, GstBuffer * outbuf)
   while (walk) {                /* We walk with this list because it's ordered */
     GstGLMixerPad *pad = GST_GL_MIXER_PAD (walk->data);
     GstGLMixerCollect *mixcol = pad->mixcol;
+    GstGLMixerFrameData *frame;
+
+    frame = g_ptr_array_index (mix->frames, array_index);
+    frame->pad = pad;
+    frame->texture = 0;
 
     walk = g_slist_next (walk);
 
@@ -1656,11 +1661,6 @@ gst_gl_mixer_process_textures (GstGLMixer * mix, GstBuffer * outbuf)
       gint64 stream_time;
       GstSegment *seg;
       guint in_tex;
-      GstGLMixerFrameData *frame;
-
-      frame = g_ptr_array_index (mix->frames, array_index);
-      frame->pad = pad;
-      frame->texture = 0;
 
       seg = &mixcol->collect.segment;