From b4d89b9809858f69045263800f72e7b797606843 Mon Sep 17 00:00:00 2001 From: Nicolas Dufresne Date: Wed, 12 Mar 2014 18:07:38 +0100 Subject: [PATCH] v4l2videodec: Protect NULL pool while going to READY When the pipeline fails early, the pool might be unset before the processing thread has run once. Add protection against that. --- sys/v4l2/gstv4l2videodec.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/sys/v4l2/gstv4l2videodec.c b/sys/v4l2/gstv4l2videodec.c index ee5f167..bb75744 100644 --- a/sys/v4l2/gstv4l2videodec.c +++ b/sys/v4l2/gstv4l2videodec.c @@ -377,6 +377,13 @@ gst_v4l2_video_dec_loop (GstVideoDecoder * decoder) * comes in and holding this lock would prevent that. */ pool = gst_video_decoder_get_buffer_pool (decoder); + + /* Pool may be NULL if we started going to READY state */ + if (pool == NULL) { + ret = GST_FLOW_FLUSHING; + goto beach; + } + ret = gst_buffer_pool_acquire_buffer (pool, &buffer, NULL); g_object_unref (pool); -- 2.7.4