v4l2videodec: Protect NULL pool while going to READY
authorNicolas Dufresne <nicolas.dufresne@collabora.com>
Wed, 12 Mar 2014 17:07:38 +0000 (18:07 +0100)
committerNicolas Dufresne <nicolas.dufresne@collabora.com>
Thu, 8 May 2014 19:56:35 +0000 (15:56 -0400)
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

index ee5f167..bb75744 100644 (file)
@@ -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);