mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-18 14:26:43 +00:00
caps: don't create broken caps for invalid media types
Check if structure has been created before appending it to the caps. Free the caps in the case of an error to not conceal it be returning empty caps. Fixes #642271
This commit is contained in:
parent
eb05020f58
commit
2bbfa3304c
1 changed files with 4 additions and 1 deletions
|
@ -225,7 +225,10 @@ gst_caps_new_simple (const char *media_type, const char *fieldname, ...)
|
|||
structure = gst_structure_new_valist (media_type, fieldname, var_args);
|
||||
va_end (var_args);
|
||||
|
||||
gst_caps_append_structure_unchecked (caps, structure);
|
||||
if (structure)
|
||||
gst_caps_append_structure_unchecked (caps, structure);
|
||||
else
|
||||
gst_caps_replace (&caps, NULL);
|
||||
|
||||
return caps;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue