display: don't crash when config is empty.

Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
This commit is contained in:
Nicolas Dufresne 2011-10-13 17:07:35 -04:00 committed by Gwenole Beauchesne
parent feaa38e22b
commit 8a1dc4978f

View file

@ -142,6 +142,9 @@ find_config(
GstVaapiConfig *config;
guint i;
if (!configs)
return FALSE;
for (i = 0; i < configs->len; i++) {
config = &g_array_index(configs, GstVaapiConfig, i);
if (config->profile == profile && config->entrypoint == entrypoint)
@ -158,6 +161,9 @@ get_profile_caps(GArray *configs)
GstCaps *out_caps, *caps;
guint i;
if (!configs)
return NULL;
out_caps = gst_caps_new_empty();
if (!out_caps)
return NULL;