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
deedaf82
Commit
deedaf82
authored
Sep 15, 2008
by
Derk-Jan Hartman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ps demux: fix an issue in ps_pkt_read()
(cherry picked from commit
d761cf6f
)
parent
e5c6c01c
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
4 deletions
+11
-4
modules/demux/ps.c
modules/demux/ps.c
+7
-2
modules/demux/ps.h
modules/demux/ps.h
+4
-2
No files found.
modules/demux/ps.c
View file @
deedaf82
...
@@ -559,10 +559,15 @@ static block_t *ps_pkt_read( stream_t *s, uint32_t i_code )
...
@@ -559,10 +559,15 @@ static block_t *ps_pkt_read( stream_t *s, uint32_t i_code )
{
{
const
uint8_t
*
p_peek
;
const
uint8_t
*
p_peek
;
int
i_peek
=
stream_Peek
(
s
,
&
p_peek
,
14
);
int
i_peek
=
stream_Peek
(
s
,
&
p_peek
,
14
);
int
i_size
=
ps_pkt_size
(
p_peek
,
i_peek
)
;
int
i_size
;
VLC_UNUSED
(
i_code
);
VLC_UNUSED
(
i_code
);
if
(
i_size
<=
6
&&
p_peek
[
3
]
>
0xba
)
/* Smallest valid packet */
if
(
i_peek
<
6
)
return
NULL
;
i_size
=
ps_pkt_size
(
p_peek
,
i_peek
);
if
(
i_size
<
0
||
(
i_size
<=
6
&&
p_peek
[
3
]
>
0xba
)
)
{
{
/* Special case, search the next start code */
/* Special case, search the next start code */
i_size
=
6
;
i_size
=
6
;
...
...
modules/demux/ps.h
View file @
deedaf82
...
@@ -22,6 +22,7 @@
...
@@ -22,6 +22,7 @@
*****************************************************************************/
*****************************************************************************/
#include <vlc_demux.h>
#include <vlc_demux.h>
#include <assert.h>
/* 256-0xC0 for normal stream, 256 for 0xbd stream, 256 for 0xfd stream */
/* 256-0xC0 for normal stream, 256 for 0xbd stream, 256 for 0xfd stream */
#define PS_TK_COUNT (768 - 0xc0)
#define PS_TK_COUNT (768 - 0xc0)
...
@@ -246,10 +247,11 @@ static inline int ps_pkt_id( block_t *p_pkt )
...
@@ -246,10 +247,11 @@ static inline int ps_pkt_id( block_t *p_pkt )
}
}
/* return the size of the next packet
/* return the size of the next packet
*
XXX y
ou need to give him at least 14 bytes (and it need to start as a
*
Y
ou need to give him at least 14 bytes (and it need to start as a
* valid packet) */
* valid packet)
It does not handle less than 6 bytes
*/
static
inline
int
ps_pkt_size
(
const
uint8_t
*
p
,
int
i_peek
)
static
inline
int
ps_pkt_size
(
const
uint8_t
*
p
,
int
i_peek
)
{
{
assert
(
i_peek
>=
6
);
if
(
p
[
3
]
==
0xb9
&&
i_peek
>=
4
)
if
(
p
[
3
]
==
0xb9
&&
i_peek
>=
4
)
{
{
return
4
;
return
4
;
...
...
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