From cdf15e90326fd6371e7808c82bd1f89a157160aa Mon Sep 17 00:00:00 2001 From: Philipp Zabel Date: Fri, 1 Mar 2019 14:58:24 +0100 Subject: [PATCH] v4l2transform: don't segfault if flushed without pools The v4l2output and v4l2capture v4l2objects can have pool == NULL if they have been stopped before. --- sys/v4l2/gstv4l2transform.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sys/v4l2/gstv4l2transform.c b/sys/v4l2/gstv4l2transform.c index 74b1a0f32f..70294c1b80 100644 --- a/sys/v4l2/gstv4l2transform.c +++ b/sys/v4l2/gstv4l2transform.c @@ -991,8 +991,10 @@ gst_v4l2_transform_sink_event (GstBaseTransform * trans, GstEvent * event) GST_DEBUG_OBJECT (self, "flush stop"); gst_v4l2_object_unlock_stop (self->v4l2capture); gst_v4l2_object_unlock_stop (self->v4l2output); - gst_v4l2_buffer_pool_flush (self->v4l2output->pool); - gst_v4l2_buffer_pool_flush (self->v4l2capture->pool); + if (self->v4l2output->pool) + gst_v4l2_buffer_pool_flush (self->v4l2output->pool); + if (self->v4l2capture->pool) + gst_v4l2_buffer_pool_flush (self->v4l2capture->pool); break; default: break;