diff options
author | Nicolas Dufresne <nicolas.dufresne@collabora.co.uk> | 2015-08-26 10:52:46 -0400 |
---|---|---|
committer | Nicolas Dufresne <nicolas.dufresne@collabora.co.uk> | 2015-08-26 10:56:07 -0400 |
commit | b392a6e3b9ae37b6a9a920e90ea7e2aa4dfac4ef (patch) | |
tree | b3744ebe6855121b9e1f05e237431062fe297144 /gst | |
parent | 9b59bb8630c8574da2a3b0db9c5cc530e7daa535 (diff) | |
download | gstreamer-plugins-bad-b392a6e3b9ae37b6a9a920e90ea7e2aa4dfac4ef.tar.gz |
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
Diffstat (limited to 'gst')
-rw-r--r-- | gst/videoparsers/gsth264parse.c | 3 | ||||
-rw-r--r-- | gst/videoparsers/gsth265parse.c | 3 |
2 files changed, 4 insertions, 2 deletions
diff --git a/gst/videoparsers/gsth264parse.c b/gst/videoparsers/gsth264parse.c index b43a81a02..915c2d7d2 100644 --- a/gst/videoparsers/gsth264parse.c +++ b/gst/videoparsers/gsth264parse.c @@ -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); diff --git a/gst/videoparsers/gsth265parse.c b/gst/videoparsers/gsth265parse.c index ecb8cf60b..d6496816e 100644 --- a/gst/videoparsers/gsth265parse.c +++ b/gst/videoparsers/gsth265parse.c @@ -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); |