[gstreamer-bugs] [Bug 459204] New: [PATCH] [playbin] gst_play_base_bin_get_streaminfo_value_array should not return NULL

GStreamer (bugzilla.gnome.org) bugzilla-daemon at bugzilla.gnome.org
Sat Jul 21 21:13:23 PDT 2007


If you have any questions why you received this email, please see the text at
the end of this email. Replies to this email are NOT read, please see the text
at the end of this email. You can add comments to this bug at:
  http://bugzilla.gnome.org/show_bug.cgi?id=459204

  GStreamer | gst-plugins-base | Ver: 0.10.x
           Summary: [PATCH] [playbin]
                    gst_play_base_bin_get_streaminfo_value_array should not
                    return NULL
           Product: GStreamer
           Version: 0.10.x
          Platform: Other
        OS/Version: Linux
            Status: UNCONFIRMED
          Severity: normal
          Priority: Normal
         Component: gst-plugins-base
        AssignedTo: gstreamer-bugs at lists.sourceforge.net
        ReportedBy: dcbw at redhat.com
         QAContact: gstreamer-bugs at lists.sourceforge.net
     GNOME version: Unspecified
   GNOME milestone: Unspecified


The python code that trigged the segfault was:

        elif t == gst.MESSAGE_STATE_CHANGED:
            old, new, pen = message.parse_state_changed()
            if old == gst.STATE_READY and (new == gst.STATE_PAUSED or new ==
gst.STATE_PLAYING):
                print self.player.props.stream_info_value_array

The problem is that get_active_group() in the playbin returns NULL at some
points.  That causes array to be NULL, which causes the boxed value to be NULL,
which causes pygobject to dereferences the returned value because it's
expecting an array.  Arguably pygobject should be more robust, but my look
through the glib code looks like NULL shouldn't be passed to
g_value_take_boxed()


static GValueArray *
gst_play_base_bin_get_streaminfo_value_array (GstPlayBaseBin * play_base_bin)
{
  GstPlayBaseGroup *group;
  GValueArray *array = NULL;

  GROUP_LOCK (play_base_bin);
  group = get_active_group (play_base_bin);
  if (group) {
    array = g_value_array_copy (group->streaminfo_value_array);
-  }
+  } else {
+    array = g_value_array_new (0);
+  }
  GROUP_UNLOCK (play_base_bin);

  return array;
}

I don't think this will leak because the GValue takes ownership of the array
anyway.  Plus, it's a GValueArray, and an empty GValueArray is actually an
allocated array with 0 elements, not a NULL.


-- 
See http://bugzilla.gnome.org/page.cgi?id=email.html for more info about why you received
this email, why you can't respond via email, how to stop receiving
emails (or reduce the number you receive), and how to contact someone
if you are having problems with the system.

You can add comments to this bug at http://bugzilla.gnome.org/show_bug.cgi?id=459204.




More information about the Gstreamer-bugs mailing list