summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSreerenj Balachandran <sreerenj.balachandran@intel.com>2016-03-11 17:34:03 +0200
committerSreerenj Balachandran <sreerenj.balachandran@intel.com>2016-03-11 17:34:03 +0200
commit92f4eb45abbe5ada79d8752b58949f2a73af6d90 (patch)
treeb62e2e50035173620c2fac7d3ab769729bb4452c
parent610705cbb4650fb216cf35573d20630e0df9458d (diff)
downloadgstreamer-plugins-bad-92f4eb45abbe5ada79d8752b58949f2a73af6d90.tar.gz
videoparsers: h265: Fix segfault while transforming hevc to nal aligned bytestream
Create temporary ParseFrame and copy the nal size buffer region for each nal unit like we did for h264. https://bugzilla.gnome.org/show_bug.cgi?id=763494
-rw-r--r--gst/videoparsers/gsth265parse.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/gst/videoparsers/gsth265parse.c b/gst/videoparsers/gsth265parse.c
index 96251222f..5a1984d84 100644
--- a/gst/videoparsers/gsth265parse.c
+++ b/gst/videoparsers/gsth265parse.c
@@ -762,12 +762,21 @@ gst_h265_parse_handle_frame_packetized (GstBaseParse * parse,
/* dispatch per NALU if needed */
if (h265parse->split_packetized) {
+ GstBaseParseFrame tmp_frame;
+
+ gst_base_parse_frame_init (&tmp_frame);
+ tmp_frame.flags |= frame->flags;
+ tmp_frame.offset = frame->offset;
+ tmp_frame.overhead = frame->overhead;
+ tmp_frame.buffer = gst_buffer_copy_region (buffer, GST_BUFFER_COPY_ALL,
+ nalu.offset, nalu.size);
+
/* note we don't need to come up with a sub-buffer, since
* subsequent code only considers input buffer's metadata.
* Real data is either taken from input by baseclass or
* a replacement output buffer is provided anyway. */
- gst_h265_parse_parse_frame (parse, frame);
- ret = gst_base_parse_finish_frame (parse, frame, nl + nalu.size);
+ gst_h265_parse_parse_frame (parse, &tmp_frame);
+ ret = gst_base_parse_finish_frame (parse, &tmp_frame, nl + nalu.size);
left -= nl + nalu.size;
}