gnomevfssrc: Fix possible NULL pointer dereference

It's always an error if gst_buffer_try_new_and_alloc() returns NULL
This commit is contained in:
Sebastian Dröge 2010-06-14 11:08:10 +02:00
parent 611d87ce7a
commit 9c570dbced

View file

@ -624,7 +624,7 @@ gst_gnome_vfs_src_create (GstBaseSrc * basesrc, guint64 offset, guint size,
} }
buf = gst_buffer_try_new_and_alloc (size); buf = gst_buffer_try_new_and_alloc (size);
if (G_UNLIKELY (buf == NULL && size == 0)) { if (G_UNLIKELY (buf == NULL)) {
GST_ERROR_OBJECT (src, "Failed to allocate %u bytes", size); GST_ERROR_OBJECT (src, "Failed to allocate %u bytes", size);
return GST_FLOW_ERROR; return GST_FLOW_ERROR;
} }