From c7917df7e22f1fcf543cea1acb4066d13f4e1d41 Mon Sep 17 00:00:00 2001 From: Edward Hervey Date: Sat, 11 Nov 2017 07:45:42 +0100 Subject: [PATCH] theoradec: Handle negotiation failure Avoids a trove of random issues afterwards (due to decoder not *actually* being initialized/negotiated). --- ext/theora/gsttheoradec.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/ext/theora/gsttheoradec.c b/ext/theora/gsttheoradec.c index 14bd5b81d3..01f738d0c4 100644 --- a/ext/theora/gsttheoradec.c +++ b/ext/theora/gsttheoradec.c @@ -516,7 +516,8 @@ theora_handle_type_packet (GstTheoraDec * dec) dec->uncropped_info = state->info; - gst_video_decoder_negotiate (GST_VIDEO_DECODER (dec)); + if (!gst_video_decoder_negotiate (GST_VIDEO_DECODER (dec))) + goto not_negotiated; dec->have_header = TRUE; @@ -528,6 +529,12 @@ unsupported_format: GST_ERROR_OBJECT (dec, "Invalid pixel format %d", dec->info.pixel_fmt); return GST_FLOW_ERROR; } + +not_negotiated: + { + GST_ERROR_OBJECT (dec, "Failed to negotiate"); + return GST_FLOW_NOT_NEGOTIATED; + } } static GstFlowReturn