[Bug 733974] New: gstbufferpool::default_alloc_buffer does not fail if buffer allocation fails

GStreamer (bugzilla.gnome.org) bugzilla at gnome.org
Wed Jul 30 05:28:20 PDT 2014


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

           Summary: gstbufferpool::default_alloc_buffer does not fail if
                    buffer allocation fails
    Classification: Platform
           Product: GStreamer
           Version: 1.4.0
        OS/Version: Linux
            Status: UNCONFIRMED
          Severity: normal
          Priority: Normal
         Component: gstreamer (core)
        AssignedTo: gstreamer-bugs at lists.freedesktop.org
        ReportedBy: msameer at foolab.org
         QAContact: gstreamer-bugs at lists.freedesktop.org
     GNOME version: ---


Currently do_alloc_buffer() calls default_alloc_buffer() which calls
gst_buffer_new_allocate()

If gst_buffer_new_allocate() fails to allocate a buffer and returns NULL then
default_alloc_buffer() should check for that NULL buffer and return an error
which is not the case currently.

I am not yet attached a patch since I am not sure what to do. A proposed fix
could be:
diff --git a/gst/gstbufferpool.c b/gst/gstbufferpool.c
index 6509225..5cd5ddc 100644
--- a/gst/gstbufferpool.c
+++ b/gst/gstbufferpool.c
@@ -227,6 +227,9 @@ default_alloc_buffer (GstBufferPool * pool, GstBuffer **
buffer,
   *buffer =
       gst_buffer_new_allocate (priv->allocator, priv->size, &priv->params);

+  if (!*buffer)
+    return GST_FLOW_ERROR;
+
   return GST_FLOW_OK;
 }


However the documentation of GStreamer says that elements returning
GST_FLOW_ERROR should post an error message wth more details and I am not sure
how to do this since GstBufferPool is not really a GstElement.

-- 
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