From 59749833bb702d59d7a6c0c6935f388dd602b2f2 Mon Sep 17 00:00:00 2001 From: Mohammed Sameer Date: Wed, 30 Jul 2014 15:46:22 +0300 Subject: [PATCH] bufferpool: Add missing error checking to default_alloc_buffer() 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 | 3 +++ 1 file changed, 3 insertions(+) diff --git a/gst/gstbufferpool.c b/gst/gstbufferpool.c index 6509225b92..5cd5ddc188 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; } -- 2.34.1