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/5394>
This commit is contained in:
Seungha Yang 2023-09-27 01:12:01 +09:00
parent 0e6cd64232
commit a7353d8859

View file

@ -1661,6 +1661,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);