summaryrefslogtreecommitdiff
path: root/gst-libs
diff options
context:
space:
mode:
authorNicolas Dufresne <nicolas.dufresne@collabora.com>2018-11-02 14:18:54 -0400
committerSebastian Dröge <slomo@coaxion.net>2018-11-06 07:26:03 +0000
commitcf7ea41c7531af4e647614f1f045211f60694abc (patch)
treefb09d57e45b2c93cc8ed5af0f3fde684ed8f18fa /gst-libs
parentdff857463a878c6d1886e55bb1bda3fd9b426e9e (diff)
downloadgstreamer-plugins-bad-cf7ea41c7531af4e647614f1f045211f60694abc.tar.gz
h264parser: Stop considering 5 bytes NAL complete
This is only TRUE for SEQ_END / STREAM_END. Before this patch, passing any valid 5 bytes of a NAL would make the parser pretend this NAL is complete.
Diffstat (limited to 'gst-libs')
-rw-r--r--gst-libs/gst/codecparsers/gsth264parser.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/gst-libs/gst/codecparsers/gsth264parser.c b/gst-libs/gst/codecparsers/gsth264parser.c
index 73968db93..30d6aea49 100644
--- a/gst-libs/gst/codecparsers/gsth264parser.c
+++ b/gst-libs/gst/codecparsers/gsth264parser.c
@@ -1343,7 +1343,13 @@ gst_h264_parser_identify_nalu (GstH264NalParser * nalparser,
gst_h264_parser_identify_nalu_unchecked (nalparser, data, offset, size,
nalu);
- if (res != GST_H264_PARSER_OK || nalu->size == 1)
+ if (res != GST_H264_PARSER_OK)
+ goto beach;
+
+ /* The two NALs are exactly 1 byte size and are placed at the end of an AU,
+ * there is no need to wait for the following */
+ if (nalu->type == GST_H264_NAL_SEQ_END ||
+ nalu->type == GST_H264_NAL_STREAM_END)
goto beach;
off2 = scan_for_start_codes (data + nalu->offset, size - nalu->offset);