summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorNicolas Dufresne <nicolas@ndufresne.ca>2017-10-07 21:17:53 +0000
committerNicolas Dufresne <nicolas.dufresne@collabora.com>2017-10-07 17:33:41 -0400
commit9ad90f3bf2caae9c1f485be04b6e11109ce0ce1a (patch)
tree43ff56fd52baa7af135026e42f4a63a0c4e467e9 /sys
parentd5f72418c8c7b8122d4dadf274bfbc75c9378c2d (diff)
v4l2videodec: Protect against null pool in _stop
This may happen if the negotiation fails, as we will have never created the pools.
Diffstat (limited to 'sys')
-rw-r--r--sys/v4l2/gstv4l2videoenc.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/v4l2/gstv4l2videoenc.c b/sys/v4l2/gstv4l2videoenc.c
index c322f5dfd..72db259e1 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);