Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc
Commits
d454281f
Commit
d454281f
authored
Feb 22, 2015
by
Francois Cartegnie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
demux: ts: prevent unwanted read at end of media
Truncated packets at the end
parent
29533737
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
0 deletions
+7
-0
modules/demux/ts.c
modules/demux/ts.c
+7
-0
No files found.
modules/demux/ts.c
View file @
d454281f
...
...
@@ -460,6 +460,7 @@ static void SetPrgFilter( demux_t *, int i_prg, bool b_selected );
#define TS_PACKET_SIZE_192 192
#define TS_PACKET_SIZE_204 204
#define TS_PACKET_SIZE_MAX 204
#define TS_HEADER_SIZE 4
static
int
DetectPacketSize
(
demux_t
*
p_demux
,
int
*
pi_header_size
,
int
i_offset
)
{
...
...
@@ -2409,6 +2410,12 @@ static block_t* ReadTSPacket( demux_t *p_demux )
return
NULL
;
}
if
(
p_pkt
->
i_buffer
<
TS_HEADER_SIZE
+
p_sys
->
i_packet_header_size
)
{
block_Release
(
p_pkt
);
return
NULL
;
}
/* Skip header (BluRay streams).
* re-sync logic would do this (by adjusting packet start), but this would result in losing first and last ts packets.
* First packet is usually PAT, and losing it means losing whole first GOP. This is fatal with still-image based menus.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment