From 0dcabd66fbe2973c00eb09772b0c4ef7ec28e6dd Mon Sep 17 00:00:00 2001 From: Nicolas Dufresne Date: Fri, 2 Nov 2018 14:18:54 -0400 Subject: 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. --- gst-libs/gst/codecparsers/gsth264parser.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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); -- cgit v1.2.1