mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 12:11:13 +00:00
kms: fix crash if bo allocation failed when copying to dumb buffer
If bo allocation failed we destroy the buffer and return GST_FLOW_ERROR, but the @buffer pointer was still pointing to the address of the destroyed buffer. gst_kms_sink_copy_to_dumb_buffer() was then trying to unref it when bailing out causing a crash. Leave @buffer untouched if allocation failed to fix the crash. Also remove the check on *buffer being not NULL as gst_buffer_new() will abort if it failed. https://bugzilla.gnome.org/show_bug.cgi?id=787442
This commit is contained in:
parent
fcf8b6bb90
commit
7e38fb5422
1 changed files with 3 additions and 6 deletions
|
@ -139,14 +139,11 @@ gst_kms_buffer_pool_alloc_buffer (GstBufferPool * pool, GstBuffer ** buffer,
|
|||
priv = vpool->priv;
|
||||
info = &priv->vinfo;
|
||||
|
||||
*buffer = gst_buffer_new ();
|
||||
if (*buffer == NULL)
|
||||
goto no_memory;
|
||||
mem = gst_kms_allocator_bo_alloc (priv->allocator, info);
|
||||
if (!mem) {
|
||||
gst_buffer_unref (*buffer);
|
||||
if (!mem)
|
||||
goto no_memory;
|
||||
}
|
||||
|
||||
*buffer = gst_buffer_new ();
|
||||
gst_buffer_append_memory (*buffer, mem);
|
||||
|
||||
if (priv->add_videometa) {
|
||||
|
|
Loading…
Reference in a new issue