h264parse, h265parse: fix handling of downstream force-key-unit events

The parser handles the downstream force-key-unit event incorrectly,
it tries to parse it as an upstream force-key-unit event, does not
check the return value, and then uses uninitialized memory in
"all_headers" boolean variable.

https://bugzilla.gnome.org/show_bug.cgi?id=763793
This commit is contained in:
Aleksander Wabik 2016-03-17 19:24:32 +00:00 committed by Tim-Philipp Müller
parent a9cf8476ea
commit d8e681bb63
2 changed files with 10 additions and 4 deletions

View file

@ -2140,8 +2140,11 @@ check_pending_key_unit_event (GstEvent * pending_event,
stream_time = gst_segment_to_stream_time (segment,
GST_FORMAT_TIME, timestamp);
gst_video_event_parse_upstream_force_key_unit (pending_event,
NULL, &all_headers, &count);
if (!gst_video_event_parse_upstream_force_key_unit (pending_event,
NULL, &all_headers, &count)) {
gst_video_event_parse_downstream_force_key_unit (pending_event, NULL,
NULL, NULL, &all_headers, &count);
}
event =
gst_video_event_new_downstream_force_key_unit (timestamp, stream_time,

View file

@ -1714,8 +1714,11 @@ check_pending_key_unit_event (GstEvent * pending_event, GstSegment * segment,
stream_time = gst_segment_to_stream_time (segment,
GST_FORMAT_TIME, timestamp);
gst_video_event_parse_upstream_force_key_unit (pending_event,
NULL, &all_headers, &count);
if (!gst_video_event_parse_upstream_force_key_unit (pending_event,
NULL, &all_headers, &count)) {
gst_video_event_parse_downstream_force_key_unit (pending_event, NULL,
NULL, NULL, &all_headers, &count);
}
event =
gst_video_event_new_downstream_force_key_unit (timestamp, stream_time,