Skip to content

Commit 87d503b

Browse files
committed
fix: ps startcode leading length
1 parent 8c84c3b commit 87d503b

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

libmpeg/source/mpeg-ts-h264.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ int mpeg_h264_find_new_access_unit(const uint8_t* data, size_t bytes, int* vcl)
147147
{
148148
// pes data loss ???
149149
*vcl = MPEG_VCL_CORRUPT;
150-
return (int)(p - data + n - leading);
150+
return (int)(p - data + n - (leading>3?3:leading));
151151
}
152152
else
153153
{

libmpeg/source/mpeg-ts-h265.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ int mpeg_h265_find_new_access_unit(const uint8_t* data, size_t bytes, int* vcl)
122122
{
123123
// pes data loss ???
124124
*vcl = MPEG_VCL_CORRUPT; // for assert
125-
return (int)(p - data + n - leading);
125+
return (int)(p - data + n - (leading > 3 ? 3 : leading));
126126
}
127127
else
128128
{

libmpeg/source/mpeg-ts-h266.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ int mpeg_h266_find_new_access_unit(const uint8_t* data, size_t bytes, int* vcl)
8686
{
8787
// pes data loss ???
8888
*vcl = MPEG_VCL_CORRUPT; // for assert
89-
return (int)(p - data + n - leading);
89+
return (int)(p - data + n - (leading > 3 ? 3 : leading));
9090
}
9191
else
9292
{

0 commit comments

Comments
 (0)