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
7c321e8a
Commit
7c321e8a
authored
Jan 13, 2009
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
decomp: fix reading after peeking
parent
71042a86
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
7 deletions
+12
-7
modules/stream_filter/decomp.c
modules/stream_filter/decomp.c
+12
-7
No files found.
modules/stream_filter/decomp.c
View file @
7c321e8a
...
...
@@ -153,26 +153,31 @@ static int Read (stream_t *stream, void *buf, unsigned int buflen)
{
stream_sys_t
*
p_sys
=
stream
->
p_sys
;
block_t
*
peeked
;
size_t
bonus
=
0
;
ssize_t
length
;
if
((
peeked
=
p_sys
->
peeked
)
!=
NULL
)
{
bonus
=
(
buflen
>
peeked
->
i_buffer
)
?
peeked
->
i_buffer
:
buflen
;
memcpy
(
buf
,
peeked
->
p_buffer
,
bonus
);
peeked
->
p_buffer
+=
bonus
;
peeked
->
i_buffer
-=
bonus
;
{
/* dequeue peeked data */
length
=
(
buflen
>
peeked
->
i_buffer
)
?
peeked
->
i_buffer
:
buflen
;
memcpy
(
buf
,
peeked
->
p_buffer
,
length
);
buf
=
((
char
*
)
buf
)
+
length
;
buflen
-=
length
;
peeked
->
p_buffer
+=
length
;
peeked
->
i_buffer
-=
length
;
if
(
peeked
->
i_buffer
==
0
)
{
block_Release
(
peeked
);
p_sys
->
peeked
=
NULL
;
}
p_sys
->
offset
+=
length
;
if
(
buflen
>
0
)
length
+=
Read
(
stream
,
((
char
*
)
buf
)
+
length
,
buflen
-
length
);
return
length
;
}
length
=
net_Read
(
stream
,
p_sys
->
read_fd
,
NULL
,
buf
,
buflen
,
false
);
if
(
length
<
0
)
return
0
;
length
+=
bonus
;
p_sys
->
offset
+=
length
;
return
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