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.
This commit is contained in:
Nicolas Dufresne 2014-03-12 18:07:38 +01:00
parent b5dde037b4
commit b4d89b9809

View file

@ -377,6 +377,13 @@ gst_v4l2_video_dec_loop (GstVideoDecoder * decoder)
* comes in and holding this lock would prevent that. * comes in and holding this lock would prevent that.
*/ */
pool = gst_video_decoder_get_buffer_pool (decoder); 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); ret = gst_buffer_pool_acquire_buffer (pool, &buffer, NULL);
g_object_unref (pool); g_object_unref (pool);