mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-30 05:31:15 +00:00
libs: decoder: fix a crash issue when get_surface_formats.
Some context does not report any valid format that we can support. For example, the HEVC 444 12 bits decoder context, all the formats it reports is not supported now, which make the formats list a NULL array. We should check that pointer before we use it. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-vaapi/-/merge_requests/372>
This commit is contained in:
parent
7a9a99d0c4
commit
6ab488475a
1 changed files with 2 additions and 0 deletions
|
@ -1192,6 +1192,8 @@ gst_vaapi_decoder_get_surface_attributes (GstVaapiDecoder * decoder,
|
|||
if (ret)
|
||||
attribs.formats = gst_vaapi_context_get_surface_formats (decoder->context);
|
||||
|
||||
if (!attribs.formats)
|
||||
return NULL;
|
||||
if (attribs.formats->len == 0) {
|
||||
g_array_unref (attribs.formats);
|
||||
return NULL;
|
||||
|
|
Loading…
Reference in a new issue