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
51ae5f27
Commit
51ae5f27
authored
Nov 22, 2006
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix a bunch of old crashers in the plugin cache
parent
b66d681a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
16 deletions
+21
-16
src/misc/modules.c
src/misc/modules.c
+21
-16
No files found.
src/misc/modules.c
View file @
51ae5f27
...
...
@@ -1702,21 +1702,25 @@ static void CacheLoad( vlc_object_t *p_this )
#define LOAD_IMMEDIATE(a) \
if( fread( (void *)&a, sizeof(char), sizeof(a), file ) != sizeof(a) ) goto error
#define LOAD_STRING(a) \
{ if( fread( &i_size, sizeof(char), sizeof(i_size), file ) \
a = NULL; \
if( fread( &i_size, sizeof(char), sizeof(i_size), file ) \
!= sizeof(i_size) ) goto error; \
if( i_size && i_size < 16384 ) { \
a = malloc( i_size ); \
if( fread( (void *)a, sizeof(char), i_size, file ) != (size_t)i_size ) \
goto error; \
if( a[i_size-1] ) { \
free( (void *)a ); a = 0; \
goto error; } \
} else a = 0; \
} while(0)
if( i_size && i_size < 16384 ) { \
char *psz = malloc( i_size ); \
if( fread( psz, i_size, 1, file ) != 1 ) { \
free( psz ); \
goto error; \
} \
if( psz[i_size-1] ) { \
free( psz ); \
goto error; \
} \
a = psz; \
}
for
(
i
=
0
;
i
<
i_cache
;
i
++
)
{
int16_t
i_size
;
u
int16_t
i_size
;
int
i_submodules
;
pp_cache
[
i
]
=
malloc
(
sizeof
(
module_cache_t
)
);
...
...
@@ -1796,7 +1800,7 @@ static void CacheLoad( vlc_object_t *p_this )
int
CacheLoadConfig
(
module_t
*
p_module
,
FILE
*
file
)
{
int
i
,
j
,
i_lines
;
int16_t
i_size
;
u
int16_t
i_size
;
/* Calculate the structure length */
LOAD_IMMEDIATE
(
p_module
->
i_config_items
);
...
...
@@ -2004,8 +2008,8 @@ static void CacheSave( vlc_object_t *p_this )
for
(
i
=
0
;
i
<
i_cache
;
i
++
)
{
int16_t
i_size
;
int32_t
i_submodule
;
u
int16_t
i_size
;
u
int32_t
i_submodule
;
/* Save common info */
SAVE_STRING
(
pp_cache
[
i
]
->
psz_file
);
...
...
@@ -2038,7 +2042,8 @@ static void CacheSave( vlc_object_t *p_this )
i_submodule
=
pp_cache
[
i
]
->
p_module
->
i_children
;
SAVE_IMMEDIATE
(
i_submodule
);
for
(
i_submodule
=
0
;
i_submodule
<
pp_cache
[
i
]
->
p_module
->
i_children
;
for
(
i_submodule
=
0
;
i_submodule
<
(
unsigned
)
pp_cache
[
i
]
->
p_module
->
i_children
;
i_submodule
++
)
{
module_t
*
p_module
=
...
...
@@ -2074,7 +2079,7 @@ void CacheSaveConfig( module_t *p_module, FILE *file )
{
int
i
,
j
,
i_lines
=
0
;
module_config_t
*
p_item
;
int16_t
i_size
;
u
int16_t
i_size
;
SAVE_IMMEDIATE
(
p_module
->
i_config_items
);
SAVE_IMMEDIATE
(
p_module
->
i_bool_items
);
...
...
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