From 4ba93e9f1a460452a9baaff4038d6d99cf387627 Mon Sep 17 00:00:00 2001 From: =?utf8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Thu, 30 Sep 2010 15:28:23 +0200 Subject: [PATCH] v4l2sink: Protect against NULL-pointer access gst_v4l2sink_change_state() would free the pool without checking whether there was a valid pool... --- sys/v4l2/gstv4l2sink.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/v4l2/gstv4l2sink.c b/sys/v4l2/gstv4l2sink.c index 679f7e2..7dc1382 100644 --- a/sys/v4l2/gstv4l2sink.c +++ b/sys/v4l2/gstv4l2sink.c @@ -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)) -- 2.7.4