Commit 2bbfa330 authored by Jonathan Matthew's avatar Jonathan Matthew 🍮 Committed by Stefan Kost
Browse files

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
parent eb05020f
......@@ -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);
if (structure)
gst_caps_append_structure_unchecked (caps, structure);
gst_caps_replace (&caps, NULL);
return caps;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment