h264parse/h265parse: Fix negotiation crash

As it's recursive, gst_pad_get_allowed_caps() may also return
empty for anything incompatible downstream. EMPTY is not valid caps
value for gst_caps_fixate(). This lead to assertion and then crash.
Ideally, the negotiate function should be re-factored to have a return
value, and we could make the negotiation fails earlier.

https://bugzilla.gnome.org/show_bug.cgi?id=754122
This commit is contained in:
Nicolas Dufresne 2015-08-26 10:52:46 -04:00
parent 9b59bb8630
commit b392a6e3b9
2 changed files with 4 additions and 2 deletions

View file

@ -387,7 +387,8 @@ gst_h264_parse_negotiate (GstH264Parse * h264parse, gint in_format,
}
}
if (caps) {
/* FIXME We could fail the negotiation immediatly if caps are empty */
if (caps && !gst_caps_is_empty (caps)) {
/* fixate to avoid ambiguity with lists when parsing */
caps = gst_caps_fixate (caps);
gst_h264_parse_format_from_caps (caps, &format, &align);

View file

@ -338,7 +338,8 @@ gst_h265_parse_negotiate (GstH265Parse * h265parse, gint in_format,
}
}
if (caps) {
/* FIXME We could fail the negotiation immediatly if caps are empty */
if (caps && !gst_caps_is_empty (caps)) {
/* fixate to avoid ambiguity with lists when parsing */
caps = gst_caps_fixate (caps);
gst_h265_parse_format_from_caps (caps, &format, &align);