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: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5401>
This commit is contained in:
Seungha Yang 2023-09-27 01:12:01 +09:00 committed by Tim-Philipp Müller
parent ca2f7a4254
commit c7f7c8e346

View file

@ -1686,6 +1686,11 @@ gst_d3d11_decoder_negotiate (GstD3D11Decoder * decoder,
info = &decoder->output_info; info = &decoder->output_info;
input_state = decoder->input_state; input_state = decoder->input_state;
if (!decoder->configured) {
GST_WARNING_OBJECT (videodec, "Decoder is not configured");
return FALSE;
}
alternate_interlaced = alternate_interlaced =
(GST_VIDEO_INFO_INTERLACE_MODE (info) == (GST_VIDEO_INFO_INTERLACE_MODE (info) ==
GST_VIDEO_INTERLACE_MODE_ALTERNATE); GST_VIDEO_INTERLACE_MODE_ALTERNATE);