[gstreamer-bugs] [Bug 357185] New: GstController binding crashes on bad arguments

GStreamer (bugzilla.gnome.org) bugzilla-daemon at bugzilla.gnome.org
Fri Sep 22 05:32:05 PDT 2006


Do not reply to this via email (we are currently unable to handle email
responses and they get discarded).  You can add comments to this bug at
http://bugzilla.gnome.org/show_bug.cgi?id=357185

GStreamer | gst-python | Ver: HEAD CVS

           Summary: GstController binding crashes on bad arguments
           Product: GStreamer
           Version: HEAD CVS
          Platform: Other
        OS/Version: All
            Status: UNCONFIRMED
          Severity: normal
          Priority: Normal
         Component: gst-python
        AssignedTo: gstreamer-bugs at lists.sourceforge.net
        ReportedBy: mail at renestadler.de
         QAContact: johan at gnome.org
     GNOME version: Unspecified
   GNOME milestone: Unspecified


Consider these snippets, each run with

>>> import pygst; pygst.require ("0.10"); import gst

before:

>>> gst.Controller ("spam")
Segmentation fault

>>> gst.Controller (gst.element_factory_make ("volume"), None)
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
RuntimeError: could not create GstController object

>>> gst.Controller (gst.element_factory_make ("volume"), "volume", -1)
Segmentation fault

>>> c = gst.Controller (gst.element_factory_make ("volume"), "volume")
>>> c.remove_properties (None)
Segmentation fault


After attached patch is applied, these come out as:

>>> gst.Controller ("spam")
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
TypeError: argument 1 must be gobject.GObject, not str

>>> gst.Controller (gst.element_factory_make ("volume"), None)
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
TypeError: expected string or Unicode object, NoneType found

>>> gst.Controller (gst.element_factory_make ("volume"), "volume", -1)
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
TypeError: expected string or Unicode object, int found

>>> c = gst.Controller (gst.element_factory_make ("volume"), "volume")
>>> c.remove_properties (None)
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
TypeError: expected string or Unicode object, NoneType found

A lot nicer, isn't it?  The patch also fixes leaking the GLists (though their
data is _not_ leaked, the string pointer destinations are owned by python).

There are still more ways to crash, I will provide more patches later and close
the bug once I'm satisfied :-)


-- 
Configure bugmail: http://bugzilla.gnome.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.




More information about the Gstreamer-bugs mailing list