mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-19 20:46:22 +00:00
v4l2src: don't deref NULL
Error out when the pool gets shutdown.
This commit is contained in:
parent
e5b6c1324b
commit
3d9d34bd60
3 changed files with 14 additions and 0 deletions
|
@ -517,6 +517,12 @@ gst_jpegenc_chain (GstPad * pad, GstBuffer * buf)
|
||||||
jpegenc->jdest.next_output_byte = GST_BUFFER_DATA (jpegenc->output_buffer);
|
jpegenc->jdest.next_output_byte = GST_BUFFER_DATA (jpegenc->output_buffer);
|
||||||
jpegenc->jdest.free_in_buffer = GST_BUFFER_SIZE (jpegenc->output_buffer);
|
jpegenc->jdest.free_in_buffer = GST_BUFFER_SIZE (jpegenc->output_buffer);
|
||||||
|
|
||||||
|
/* FIXME: shouldn't we also set
|
||||||
|
* - jpegenc->cinfo.max_{v,h}_samp_factor
|
||||||
|
* - jpegenc->cinfo.comp_info[0,1,2].{v,h}_samp_factor
|
||||||
|
* accordingly?
|
||||||
|
*/
|
||||||
|
|
||||||
/* prepare for raw input */
|
/* prepare for raw input */
|
||||||
#if JPEG_LIB_VERSION >= 70
|
#if JPEG_LIB_VERSION >= 70
|
||||||
jpegenc->cinfo.do_fancy_downsampling = FALSE;
|
jpegenc->cinfo.do_fancy_downsampling = FALSE;
|
||||||
|
|
|
@ -105,6 +105,8 @@ gst_v4l2src_grab_frame (GstV4l2Src * v4l2src, GstBuffer ** buf)
|
||||||
|
|
||||||
v4l2object = v4l2src->v4l2object;
|
v4l2object = v4l2src->v4l2object;
|
||||||
pool = v4l2src->pool;
|
pool = v4l2src->pool;
|
||||||
|
if (!pool)
|
||||||
|
goto no_buffer_pool;
|
||||||
|
|
||||||
GST_DEBUG_OBJECT (v4l2src, "grab frame");
|
GST_DEBUG_OBJECT (v4l2src, "grab frame");
|
||||||
|
|
||||||
|
@ -174,6 +176,11 @@ gst_v4l2src_grab_frame (GstV4l2Src * v4l2src, GstBuffer ** buf)
|
||||||
return GST_FLOW_OK;
|
return GST_FLOW_OK;
|
||||||
|
|
||||||
/* ERRORS */
|
/* ERRORS */
|
||||||
|
no_buffer_pool:
|
||||||
|
{
|
||||||
|
GST_DEBUG ("no buffer pool");
|
||||||
|
return GST_FLOW_WRONG_STATE;
|
||||||
|
}
|
||||||
select_error:
|
select_error:
|
||||||
{
|
{
|
||||||
GST_ELEMENT_ERROR (pool->v4l2elem, RESOURCE, READ, (NULL),
|
GST_ELEMENT_ERROR (pool->v4l2elem, RESOURCE, READ, (NULL),
|
||||||
|
|
|
@ -82,6 +82,7 @@ endif
|
||||||
|
|
||||||
check_PROGRAMS = \
|
check_PROGRAMS = \
|
||||||
generic/states \
|
generic/states \
|
||||||
|
generic/capsrenegotiation \
|
||||||
$(check_annodex) \
|
$(check_annodex) \
|
||||||
elements/alphacolor \
|
elements/alphacolor \
|
||||||
elements/aspectratiocrop \
|
elements/aspectratiocrop \
|
||||||
|
|
Loading…
Reference in a new issue