diff --git a/gst-libs/gst/vaapi/gstvaapidecoder_h264.c b/gst-libs/gst/vaapi/gstvaapidecoder_h264.c index ac45427645..a0698659d8 100644 --- a/gst-libs/gst/vaapi/gstvaapidecoder_h264.c +++ b/gst-libs/gst/vaapi/gstvaapidecoder_h264.c @@ -4381,6 +4381,9 @@ gst_vaapi_decoder_h264_decode_codec_data (GstVaapiDecoder * base_decoder, GstH264ParserResult result; guint i, ofs, num_sps, num_pps; + if (!priv->is_opened) + return GST_VAAPI_DECODER_STATUS_SUCCESS; + unit.parsed_info = NULL; if (buf_size < 7) diff --git a/gst-libs/gst/vaapi/gstvaapidecoder_h265.c b/gst-libs/gst/vaapi/gstvaapidecoder_h265.c index 9d2fa6ee17..e9353cf40b 100644 --- a/gst-libs/gst/vaapi/gstvaapidecoder_h265.c +++ b/gst-libs/gst/vaapi/gstvaapidecoder_h265.c @@ -2653,6 +2653,9 @@ gst_vaapi_decoder_h265_decode_codec_data (GstVaapiDecoder * guint num_nal_arrays, num_nals; guint i, j, ofs; + if (!priv->is_opened) + return GST_VAAPI_DECODER_STATUS_SUCCESS; + unit.parsed_info = NULL; if (buf_size < 23) return GST_VAAPI_DECODER_STATUS_ERROR_NO_DATA;