libs: decoder: fix a crash issue when get_surface_formats.
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>

ceyusa/gstreamer-vaapi,GStreamer/gstreamer-vaapi,ceyusa/gstreamer-vaapi,GStreamer/gstreamer-vaapi