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
227c679c
Commit
227c679c
authored
Jan 13, 2009
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
decomp: handle NULL reads (skipping data) properly - fixes #2409
parent
5c63462c
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
2 deletions
+10
-2
modules/stream_filter/decomp.c
modules/stream_filter/decomp.c
+10
-2
No files found.
modules/stream_filter/decomp.c
View file @
227c679c
...
@@ -143,6 +143,8 @@ static void *Thread (void *data)
...
@@ -143,6 +143,8 @@ static void *Thread (void *data)
}
}
static
int
Peek
(
stream_t
*
,
const
uint8_t
**
,
unsigned
int
);
#define MIN_BLOCK (1 << 10)
#define MIN_BLOCK (1 << 10)
#define MAX_BLOCK (1 << 20)
#define MAX_BLOCK (1 << 20)
/**
/**
...
@@ -155,11 +157,17 @@ static int Read (stream_t *stream, void *buf, unsigned int buflen)
...
@@ -155,11 +157,17 @@ static int Read (stream_t *stream, void *buf, unsigned int buflen)
block_t
*
peeked
;
block_t
*
peeked
;
ssize_t
length
;
ssize_t
length
;
if
(
buf
==
NULL
)
/* caller skips data, get big enough peek buffer */
buflen
=
Peek
(
stream
,
&
(
const
uint8_t
*
){
NULL
},
buflen
);
if
((
peeked
=
p_sys
->
peeked
)
!=
NULL
)
if
((
peeked
=
p_sys
->
peeked
)
!=
NULL
)
{
/* dequeue peeked data */
{
/* dequeue peeked data */
length
=
(
buflen
>
peeked
->
i_buffer
)
?
peeked
->
i_buffer
:
buflen
;
length
=
(
buflen
>
peeked
->
i_buffer
)
?
peeked
->
i_buffer
:
buflen
;
if
(
buf
!=
NULL
)
{
memcpy
(
buf
,
peeked
->
p_buffer
,
length
);
memcpy
(
buf
,
peeked
->
p_buffer
,
length
);
buf
=
((
char
*
)
buf
)
+
length
;
buf
=
((
char
*
)
buf
)
+
length
;
}
buflen
-=
length
;
buflen
-=
length
;
peeked
->
p_buffer
+=
length
;
peeked
->
p_buffer
+=
length
;
peeked
->
i_buffer
-=
length
;
peeked
->
i_buffer
-=
length
;
...
...
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