bufferpool: Add missing error checking to default_alloc_buffer()
authorMohammed Sameer <msameer@foolab.org>
Wed, 30 Jul 2014 12:46:22 +0000 (15:46 +0300)
committerNicolas Dufresne <nicolas.dufresne@collabora.co.uk>
Wed, 30 Jul 2014 13:02:20 +0000 (09:02 -0400)
default_alloc_buffer() calls gst_buffer_new_allocate() but does not check for
failed allocation.

This patch makes default_alloc_buffer() return an error (GST_FLOW_ERROR) if
buffer allocation fails.

https://bugzilla.gnome.org/show_bug.cgi?id=733974

gst/gstbufferpool.c

index 6509225..5cd5ddc 100644 (file)
@@ -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;
 }