mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 20:21:24 +00:00
v4l2src: don't deref NULL
Error out when the pool gets shutdown.
This commit is contained in:
parent
8576a11dae
commit
21a8cb1e06
1 changed files with 7 additions and 0 deletions
|
@ -105,6 +105,8 @@ gst_v4l2src_grab_frame (GstV4l2Src * v4l2src, GstBuffer ** buf)
|
|||
|
||||
v4l2object = v4l2src->v4l2object;
|
||||
pool = v4l2src->pool;
|
||||
if (!pool)
|
||||
goto no_buffer_pool;
|
||||
|
||||
GST_DEBUG_OBJECT (v4l2src, "grab frame");
|
||||
|
||||
|
@ -174,6 +176,11 @@ gst_v4l2src_grab_frame (GstV4l2Src * v4l2src, GstBuffer ** buf)
|
|||
return GST_FLOW_OK;
|
||||
|
||||
/* ERRORS */
|
||||
no_buffer_pool:
|
||||
{
|
||||
GST_DEBUG ("no buffer pool");
|
||||
return GST_FLOW_WRONG_STATE;
|
||||
}
|
||||
select_error:
|
||||
{
|
||||
GST_ELEMENT_ERROR (pool->v4l2elem, RESOURCE, READ, (NULL),
|
||||
|
|
Loading…
Reference in a new issue