From a7353d88594dbab6b6e329155cb63059cd5da936 Mon Sep 17 00:00:00 2001 From: Seungha Yang Date: Wed, 27 Sep 2023 01:12:01 +0900 Subject: [PATCH] d3d11decoder: Fix crash on negotiate() when decoder is not configured The negotiate() can be called by GstVideoDecoder baseclass on GAP event, and decoder helper object might not be configured at the time when negotiate() is called. Part-of: --- subprojects/gst-plugins-bad/sys/d3d11/gstd3d11decoder.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/subprojects/gst-plugins-bad/sys/d3d11/gstd3d11decoder.cpp b/subprojects/gst-plugins-bad/sys/d3d11/gstd3d11decoder.cpp index 3b97c2ec71..b45d9c50d4 100644 --- a/subprojects/gst-plugins-bad/sys/d3d11/gstd3d11decoder.cpp +++ b/subprojects/gst-plugins-bad/sys/d3d11/gstd3d11decoder.cpp @@ -1661,6 +1661,11 @@ gst_d3d11_decoder_negotiate (GstD3D11Decoder * decoder, info = &decoder->output_info; input_state = decoder->input_state; + if (!decoder->configured) { + GST_WARNING_OBJECT (videodec, "Decoder is not configured"); + return FALSE; + } + alternate_interlaced = (GST_VIDEO_INFO_INTERLACE_MODE (info) == GST_VIDEO_INTERLACE_MODE_ALTERNATE);