Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
VLC-QT
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Service Desk
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Chandrakant Jena
VLC-QT
Commits
09a265cf
Commit
09a265cf
authored
2 years ago
by
François Cartegnie
Committed by
Jean-Baptiste Kempf
2 years ago
Browse files
Options
Downloads
Patches
Plain Diff
demux: ts: flag truncation as corruption
parent
10ffa49f
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
modules/demux/mpeg/ts_pes.c
+7
-2
7 additions, 2 deletions
modules/demux/mpeg/ts_pes.c
test/modules/demux/ts_pes.c
+3
-1
3 additions, 1 deletion
test/modules/demux/ts_pes.c
with
10 additions
and
3 deletions
modules/demux/mpeg/ts_pes.c
+
7
−
2
View file @
09a265cf
...
...
@@ -193,6 +193,11 @@ bool ts_pes_Gather( ts_pes_parse_callback *cb,
/* On dropped blocks discontinuity */
else
if
(
p_pkt
->
i_flags
&
BLOCK_FLAG_DISCONTINUITY
)
{
/* If we know the final size and didn't gather enough bytes it is corrupted
or if the discontinuity doesn't carry the start code */
if
(
p_pes
->
gather
.
i_gathered
&&
(
p_pes
->
gather
.
i_data_size
||
(
b_aligned_ts_payload
&&
!
b_unit_start
)
)
)
p_pes
->
gather
.
i_block_flags
|=
BLOCK_FLAG_CORRUPTED
;
b_ret
|=
ts_pes_Push
(
cb
,
p_pes
,
NULL
,
true
,
i_append_pcr
);
/* it can't match the target size and need to resync on sync code */
...
...
@@ -201,8 +206,8 @@ bool ts_pes_Gather( ts_pes_parse_callback *cb,
p_pes
->
gather
.
i_saved
=
0
;
/* Propagate to output block to notify packetizers/decoders */
if
(
p_pes
->
p_es
)
p_pes
->
p_es
->
i_next_block_flags
|=
BLOCK_FLAG_DISCONTINUITY
|
BLOCK_FLAG_CORRUPTED
;
p_pes
->
gather
.
i_block_flags
|=
BLOCK_FLAG_DISCONTINUITY
|
BLOCK_FLAG_CORRUPTED
;
p_pes
->
p_es
->
i_next_block_flags
|=
BLOCK_FLAG_DISCONTINUITY
;
p_pes
->
gather
.
i_block_flags
|=
BLOCK_FLAG_DISCONTINUITY
;
}
if
(
unlikely
(
p_pes
->
gather
.
i_saved
>
0
)
)
...
...
This diff is collapsed.
Click to expand it.
test/modules/demux/ts_pes.c
+
3
−
1
View file @
09a265cf
...
...
@@ -280,8 +280,9 @@ int main()
block_ChainProperties
(
output
,
&
outputcount
,
&
outputsize
,
NULL
);
ASSERT
(
outputcount
==
2
);
ASSERT
(
outputsize
==
sizeof
(
aligned1
)
*
2
-
1
);
ASSERT
(
output
->
i_flags
&
BLOCK_FLAG_CORRUPTED
);
/* First block is corrupted 15/16 bytes */
ASSERT
((
output
->
i_flags
&
BLOCK_FLAG_DISCONTINUITY
)
==
0
);
ASSERT
(
output
->
p_next
->
i_flags
&
BLOCK_FLAG_DISCONTINUITY
);
/* Next block resumes as discont */
ASSERT
(
output
->
p_next
->
i_flags
==
BLOCK_FLAG_DISCONTINUITY
);
/* Next block resumes as discont */
RESET
;
PKT_FROM
(
aligned1
);
...
...
@@ -295,6 +296,7 @@ int main()
block_ChainProperties
(
output
,
&
outputcount
,
&
outputsize
,
NULL
);
ASSERT
(
outputcount
==
1
);
ASSERT
(
outputsize
==
sizeof
(
aligned1
));
//ASSERT(output->i_flags == BLOCK_FLAG_CORRUPTED); /* First might be corrupted but we don't really know */
RESET
;
return
0
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment