summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksander Wabik <awabik@opera.com>2016-03-17 19:24:32 +0000
committerTim-Philipp Müller <tim@centricular.com>2016-04-06 14:29:07 +0100
commitedfaa5606c36ea869256a90480f10ba8578d21ca (patch)
treebaaf4a88f774b7ba2a535d7da7e6550f68549e40
parenta9112ffe2d77740c9a84e7bece37412f2a0a5ab2 (diff)
downloadgstreamer-plugins-bad-edfaa5606c36ea869256a90480f10ba8578d21ca.tar.gz
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
-rw-r--r--gst/videoparsers/gsth264parse.c7
-rw-r--r--gst/videoparsers/gsth265parse.c7
2 files changed, 10 insertions, 4 deletions
diff --git a/gst/videoparsers/gsth264parse.c b/gst/videoparsers/gsth264parse.c
index 915c2d7d2..166e5e70b 100644
--- a/gst/videoparsers/gsth264parse.c
+++ b/gst/videoparsers/gsth264parse.c
@@ -2128,8 +2128,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,
diff --git a/gst/videoparsers/gsth265parse.c b/gst/videoparsers/gsth265parse.c
index 4656c7287..aed83811d 100644
--- a/gst/videoparsers/gsth265parse.c
+++ b/gst/videoparsers/gsth265parse.c
@@ -1699,8 +1699,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,