v4l2sink: Protect against NULL-pointer access

gst_v4l2sink_change_state() would free the pool without checking whether there
was a valid pool...
This commit is contained in:
IOhannes m zmölnig 2010-09-30 15:28:23 +02:00 committed by Sebastian Dröge
parent 0aace5a0f3
commit 4ba93e9f1a

View file

@ -461,7 +461,8 @@ gst_v4l2sink_change_state (GstElement * element, GstStateChange transition)
}
break;
case GST_STATE_CHANGE_READY_TO_NULL:
gst_v4l2_buffer_pool_destroy (v4l2sink->pool);
if (NULL != v4l2sink->pool)
gst_v4l2_buffer_pool_destroy (v4l2sink->pool);
v4l2sink->pool = NULL;
/* close the device */
if (!gst_v4l2_object_stop (v4l2sink->v4l2object))