msdkdec: Check width and height of mfxVideoParam before allocation

DecodeHeader must be called to fill the mfxVideoParam before allocation,
and thus the check for width and height in mfxVideoParam is necessary.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1817>
This commit is contained in:
Mengkejiergeli Ba 2022-01-26 14:55:51 +08:00 committed by Haihao Xiang
parent ebf63e1b91
commit d8ab85c3ef

View file

@ -1675,6 +1675,9 @@ gst_msdkdec_decide_allocation (GstVideoDecoder * decoder, GstQuery * query)
GstCaps *pool_caps /*, *negotiated_caps */ ;
guint size, min_buffers, max_buffers;
if (!thiz->param.mfx.FrameInfo.Width || !thiz->param.mfx.FrameInfo.Height)
return FALSE;
if (!GST_VIDEO_DECODER_CLASS (parent_class)->decide_allocation (decoder,
query))
return FALSE;