From 9ad90f3bf2caae9c1f485be04b6e11109ce0ce1a Mon Sep 17 00:00:00 2001 From: Nicolas Dufresne Date: Sat, 7 Oct 2017 21:17:53 +0000 Subject: [PATCH] v4l2videodec: Protect against null pool in _stop This may happen if the negotiation fails, as we will have never created the pools. --- sys/v4l2/gstv4l2videoenc.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sys/v4l2/gstv4l2videoenc.c b/sys/v4l2/gstv4l2videoenc.c index c322f5dfdd..72db259e12 100644 --- a/sys/v4l2/gstv4l2videoenc.c +++ b/sys/v4l2/gstv4l2videoenc.c @@ -218,8 +218,10 @@ gst_v4l2_video_enc_stop (GstVideoEncoder * encoder) gst_v4l2_object_stop (self->v4l2output); gst_v4l2_object_stop (self->v4l2capture); - 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); if (self->input_state) { gst_video_codec_state_unref (self->input_state);