Commit 0fb59dbd authored by Nicolas Dufresne's avatar Nicolas Dufresne

v4l2bufferpool: Cleanly handle v4l2_allocator_new failure

parent 25c26a4c
......@@ -1418,6 +1418,8 @@ gst_v4l2_buffer_pool_new (GstV4l2Object * obj, GstCaps * caps)
pool->vallocator =
gst_v4l2_allocator_new (GST_OBJECT (pool), obj->video_fd, &obj->format);
if (pool->vallocator == NULL)
goto allocator_failed;
gst_object_ref (obj->element);
......@@ -1435,6 +1437,11 @@ dup_failed:
GST_ERROR ("failed to dup fd %d (%s)", errno, g_strerror (errno));
return NULL;
}
allocator_failed:
{
GST_ERROR_OBJECT (pool, "Failed to create V4L2 allocator");
return NULL;
}
}
static GstFlowReturn
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment