Skip to content

Commit

Permalink
formats: Support sending size 8 NAL units
Browse files Browse the repository at this point in the history
NAL units with sizes less than 8 are not yet supported in SCL.
  • Loading branch information
jrsnen committed Nov 23, 2022
1 parent a0d8e97 commit d7f0af7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/formats/h26x.cc
Original file line number Diff line number Diff line change
Expand Up @@ -152,12 +152,12 @@ ssize_t uvgrtp::formats::h26x::find_h26x_start_code(

uint64_t prefetch64 = UINT64_MAX;

while (pos + 8 < len) {
while (pos + 8 <= len) {

if (!prev_had_zero)
{
// since we know that start code prefix has zeros, we find the next dword that has zeros
while (!cur_has_zero && pos + 8 < len)
while (!cur_has_zero && pos + 8 <= len)
{
prefetch64 = *(uint64_t*)(data + pos);
#if __BYTE_ORDER == __LITTLE_ENDIAN
Expand All @@ -172,7 +172,7 @@ ssize_t uvgrtp::formats::h26x::find_h26x_start_code(
}
}

if (pos + 8 < len)
if (pos + 8 <= len)
{
cur_value32 = *(uint32_t*)(data + pos);
}
Expand Down

0 comments on commit d7f0af7

Please sign in to comment.