codecparser: h265: Fix nal unit size checking

The EOS and EOB nals have the size 2 which is the size of
nal unit header itself. The gst_h265_parser_identify_nalu()
is not required to scan start code again in this case.

In other cases, for a valid nalunit the minimum required size
is 3 bytes (2 byte header and at least 1 byte RBSP payload)
This commit is contained in:
Sreerenj Balachandran 2015-04-17 15:15:33 +03:00 committed by Sebastian Dröge
parent af7ff2bd95
commit e6e0702821

View file

@ -1269,7 +1269,7 @@ gst_h265_parser_identify_nalu (GstH265Parser * parser,
gst_h265_parser_identify_nalu_unchecked (parser, data, offset, size,
nalu);
if (res != GST_H265_PARSER_OK || nalu->size == 0)
if (res != GST_H265_PARSER_OK || nalu->size == 2)
goto beach;
off2 = scan_for_start_codes (data + nalu->offset, size - nalu->offset);
@ -1286,7 +1286,7 @@ gst_h265_parser_identify_nalu (GstH265Parser * parser,
off2--;
nalu->size = off2;
if (nalu->size < 2)
if (nalu->size < 3)
return GST_H265_PARSER_BROKEN_DATA;
GST_DEBUG ("Complete nal found. Off: %d, Size: %d", nalu->offset, nalu->size);