#undef DEF_RGB
#undef DEF_YUV
-static GArray *gst_vaapi_video_formats_map;
+static GArray *gst_vaapi_video_formats_map = NULL;
static inline gboolean
va_format_is_rgb (const VAImageFormat * va_format)
const GstVideoFormatMap *entry;
guint i;
+ if (!formats)
+ return NULL;
+
for (i = 0; i < formats->len; i++) {
entry = &g_array_index (formats, GstVideoFormatMap, i);
if (entry->format == format)
const GstVideoFormatMap *entry;
guint i;
+ if (!formats)
+ return NULL;
+
for (i = 0; i < formats->len; i++) {
entry = &g_array_index (formats, GstVideoFormatMap, i);
if (va_format_is_same (&entry->va_format, va_format))
const GstVideoFormatMap *m;
guint i;
+ if (!map)
+ return GST_VIDEO_FORMAT_UNKNOWN;
+
/* Note: VA fourcc values are now standardized and shall represent
a unique format. The associated VAImageFormat is just a hint to
determine RGBA component ordering */
const GstVideoFormatMap *m;
guint i;
+ if (!map)
+ return GST_VIDEO_FORMAT_UNKNOWN;
+
for (i = 0; i < map->len; i++) {
m = &g_array_index (map, GstVideoFormatMap, i);
if (m->drm_format == drm_format)