[Bug 727701] New: debugutils: Handle caps field values being NULL

GStreamer (bugzilla.gnome.org) bugzilla at gnome.org
Sun Apr 6 03:00:42 PDT 2014


https://bugzilla.gnome.org/show_bug.cgi?id=727701
  GStreamer | gstreamer (core) | git

           Summary: debugutils: Handle caps field values being NULL
    Classification: Platform
           Product: GStreamer
           Version: git
        OS/Version: All
            Status: UNCONFIRMED
          Severity: trivial
          Priority: Normal
         Component: gstreamer (core)
        AssignedTo: gstreamer-bugs at lists.freedesktop.org
        ReportedBy: sebras at hotmail.com
         QAContact: gstreamer-bugs at lists.freedesktop.org
     GNOME version: ---


Yesterday I tried to call GST_DEBUG_BIN_TO_DOT_FILE() on a pipeline in my
application. This caused a SIGSEGV due to a string-field in one of the caps
being NULL.

It could be argued that NULL-values are not permissible, but a program like the
one below, neither fails nor crashes despite the dummy-field having a NULL
value:

  caps = gst_caps_new_empty();
  s = gst_structure_new ("video/x-raw", "dummy", G_TYPE_STRING, NULL, NULL);
  gst_caps_append_structure (caps, s);
  GST_ERROR ("%" GST_PTR_FORMAT, caps);
  str = gst_caps_to_string (caps);
  gst_caps_unref (caps);
  caps = NULL;
  caps = gst_caps_from_string (str);
  g_free (str);
  GST_ERROR ("%" GST_PTR_FORMAT, caps);
  gst_caps_unref (caps);

So since this type of caps is allowed as input elsewhere in GStreamer my
attached patch changes GST_DEBUG_BIN_TO_DOT_FILE() to not crash in strlen() on
this type of input, but instead print the string "NULL".

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


More information about the gstreamer-bugs mailing list