summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIOhannes m zmölnig <zmoelnig@iem.at>2010-09-30 15:28:23 +0200
committerSebastian Dröge <sebastian.droege@collabora.co.uk>2010-10-10 11:23:39 +0200
commit4ba93e9f1a460452a9baaff4038d6d99cf387627 (patch)
tree31fa706754e02cbb13cf9be3f705422bf3dc72c1
parent0aace5a0f30176842fa60f8ff69d7dd90c03aa04 (diff)
v4l2sink: Protect against NULL-pointer access
gst_v4l2sink_change_state() would free the pool without checking whether there was a valid pool...
-rw-r--r--sys/v4l2/gstv4l2sink.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/v4l2/gstv4l2sink.c b/sys/v4l2/gstv4l2sink.c
index 679f7e290..7dc138293 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))