Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
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-2-2
Commits
3fdb19ce
Commit
3fdb19ce
authored
Dec 05, 2013
by
Francois Cartegnie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
access: rar: skip old volume format string on failure (fix #9835)
parent
15958ae9
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
23 additions
and
13 deletions
+23
-13
modules/access/rar/access.c
modules/access/rar/access.c
+7
-3
modules/access/rar/rar.c
modules/access/rar/rar.c
+12
-8
modules/access/rar/rar.h
modules/access/rar/rar.h
+1
-1
modules/access/rar/stream.c
modules/access/rar/stream.c
+3
-1
No files found.
modules/access/rar/access.c
View file @
3fdb19ce
...
...
@@ -156,10 +156,14 @@ int RarAccessOpen(vlc_object_t *object)
stream_t
*
s
=
stream_UrlNew
(
access
,
base
);
if
(
!
s
)
goto
error
;
int
count
;
int
count
=
0
;
rar_file_t
**
files
;
if
(
RarProbe
(
s
)
||
RarParse
(
s
,
&
count
,
&
files
)
||
count
<=
0
)
goto
error
;
if
(
RarProbe
(
s
)
||
(
RarParse
(
s
,
&
count
,
&
files
,
false
)
&&
RarParse
(
s
,
&
count
,
&
files
,
true
)
)
||
count
<=
0
)
goto
error
;
rar_file_t
*
file
=
NULL
;
for
(
int
i
=
0
;
i
<
count
;
i
++
)
{
if
(
!
file
&&
!
strcmp
(
files
[
i
]
->
name
,
name
))
...
...
modules/access/rar/rar.c
View file @
3fdb19ce
...
...
@@ -281,16 +281,16 @@ typedef struct {
const
char
*
format
;
int
start
;
int
stop
;
bool
b_extonly
;
}
rar_pattern_t
;
static
const
rar_pattern_t
*
FindVolumePattern
(
const
char
*
location
)
static
const
rar_pattern_t
*
FindVolumePattern
(
const
char
*
location
,
bool
b_extonly
)
{
static
const
rar_pattern_t
patterns
[]
=
{
{
".part1.rar"
,
"%s.part%.1d.rar"
,
2
,
9
},
{
".part01.rar"
,
"%s.part%.2d.rar"
,
2
,
99
,
},
{
".part001.rar"
,
"%s.part%.3d.rar"
,
2
,
999
},
{
".rar"
,
"%s.%c%.2d"
,
0
,
999
},
{
NULL
,
NULL
,
0
,
0
},
{
".part01.rar"
,
"%s.part%.2d.rar"
,
2
,
99
,
false
},
// new naming
{
".part001.rar"
,
"%s.part%.3d.rar"
,
2
,
999
,
false
},
// new
{
".rar"
,
"%s.%c%.2d"
,
0
,
999
,
true
},
// old
{
NULL
,
NULL
,
0
,
0
,
false
},
};
const
size_t
location_size
=
strlen
(
location
);
...
...
@@ -299,18 +299,22 @@ static const rar_pattern_t *FindVolumePattern(const char *location)
if
(
location_size
<
match_size
)
continue
;
if
(
b_extonly
&&
!
patterns
[
i
].
b_extonly
)
continue
;
if
(
!
strcmp
(
&
location
[
location_size
-
match_size
],
patterns
[
i
].
match
))
return
&
patterns
[
i
];
}
return
NULL
;
}
int
RarParse
(
stream_t
*
s
,
int
*
count
,
rar_file_t
***
file
)
int
RarParse
(
stream_t
*
s
,
int
*
count
,
rar_file_t
***
file
,
bool
b_extonly
)
{
*
count
=
0
;
*
file
=
NULL
;
const
rar_pattern_t
*
pattern
=
FindVolumePattern
(
s
->
psz_path
);
const
rar_pattern_t
*
pattern
=
FindVolumePattern
(
s
->
psz_path
,
b_extonly
);
int
volume_offset
=
0
;
char
*
volume_mrl
;
...
...
modules/access/rar/rar.h
View file @
3fdb19ce
...
...
@@ -40,7 +40,7 @@ typedef struct {
int
RarProbe
(
stream_t
*
);
void
RarFileDelete
(
rar_file_t
*
);
int
RarParse
(
stream_t
*
,
int
*
,
rar_file_t
***
);
int
RarParse
(
stream_t
*
,
int
*
,
rar_file_t
***
,
bool
);
int
RarAccessOpen
(
vlc_object_t
*
);
void
RarAccessClose
(
vlc_object_t
*
);
...
...
modules/access/rar/stream.c
View file @
3fdb19ce
...
...
@@ -72,7 +72,9 @@ int RarStreamOpen(vlc_object_t *object)
int
count
;
rar_file_t
**
files
;
const
int64_t
position
=
stream_Tell
(
s
->
p_source
);
if
(
RarParse
(
s
->
p_source
,
&
count
,
&
files
))
{
if
(
RarParse
(
s
->
p_source
,
&
count
,
&
files
,
false
)
&&
RarParse
(
s
->
p_source
,
&
count
,
&
files
,
true
)
)
{
stream_Seek
(
s
->
p_source
,
position
);
msg_Err
(
s
,
"Invalid or unsupported RAR archive"
);
free
(
files
);
...
...
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