Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-gpu
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-gpu
Commits
397df13c
Commit
397df13c
authored
May 04, 2009
by
Laurent Aimar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Do not read the whole file (in memory !) when parsing RAR.
parent
7f581337
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
3 deletions
+11
-3
modules/stream_filter/rar.c
modules/stream_filter/rar.c
+11
-3
No files found.
modules/stream_filter/rar.c
View file @
397df13c
...
...
@@ -442,15 +442,15 @@ static int SkipFile( stream_t *s,const rar_block_t *p_hdr )
stream_sys_t
*
p_sys
=
s
->
p_sys
;
const
uint8_t
*
p_peek
;
if
(
stream_Peek
(
s
->
p_source
,
&
p_peek
,
p_hdr
->
i_size
)
<
p_hdr
->
i_size
)
return
VLC_EGENERIC
;
int
i_min_size
=
7
+
21
;
if
(
p_hdr
->
i_flags
&
RAR_BLOCK_FILE_HAS_HIGH
)
i_min_size
+=
8
;
if
(
p_hdr
->
i_size
<
i_min_size
)
return
VLC_EGENERIC
;
if
(
stream_Peek
(
s
->
p_source
,
&
p_peek
,
i_min_size
)
<
i_min_size
)
return
VLC_EGENERIC
;
/* */
uint32_t
i_file_size_low
=
GetDWLE
(
&
p_peek
[
7
+
4
]
);
uint8_t
i_method
=
p_peek
[
7
+
18
];
...
...
@@ -465,7 +465,15 @@ static int SkipFile( stream_t *s,const rar_block_t *p_hdr )
const
int
i_name_offset
=
(
p_hdr
->
i_flags
&
RAR_BLOCK_FILE_HAS_HIGH
)
?
(
7
+
33
)
:
(
7
+
25
);
if
(
i_name_offset
+
i_name_size
<=
p_hdr
->
i_size
)
{
const
int
i_max_size
=
i_name_offset
+
i_name_size
;
if
(
stream_Peek
(
s
->
p_source
,
&
p_peek
,
i_max_size
)
<
i_max_size
)
{
free
(
psz_name
);
return
VLC_EGENERIC
;
}
memcpy
(
psz_name
,
&
p_peek
[
i_name_offset
],
i_name_size
);
}
if
(
i_method
!=
0x30
)
{
...
...
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