mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-19 06:46:38 +00:00
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:
parent
af7ff2bd95
commit
e6e0702821
1 changed files with 2 additions and 2 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue