Commit fcf49602 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

- Fix today's regression in plugin cache

- Fix one more old crasher in the plugin cache loader
parent a053437d
...@@ -1702,10 +1702,12 @@ static void CacheLoad( vlc_object_t *p_this ) ...@@ -1702,10 +1702,12 @@ static void CacheLoad( vlc_object_t *p_this )
#define LOAD_IMMEDIATE(a) \ #define LOAD_IMMEDIATE(a) \
if( fread( (void *)&a, sizeof(char), sizeof(a), file ) != sizeof(a) ) goto error if( fread( (void *)&a, sizeof(char), sizeof(a), file ) != sizeof(a) ) goto error
#define LOAD_STRING(a) \ #define LOAD_STRING(a) \
{ \
a = NULL; \ a = NULL; \
if( fread( &i_size, sizeof(char), sizeof(i_size), file ) \ if( ( fread( &i_size, sizeof(i_size), 1, file ) != 1 ) \
!= sizeof(i_size) ) goto error; \ || ( i_size > 16384 ) ) \
if( i_size && i_size < 16384 ) { \ goto error; \
if( i_size ) { \
char *psz = malloc( i_size ); \ char *psz = malloc( i_size ); \
if( fread( psz, i_size, 1, file ) != 1 ) { \ if( fread( psz, i_size, 1, file ) != 1 ) { \
free( psz ); \ free( psz ); \
...@@ -1716,7 +1718,8 @@ static void CacheLoad( vlc_object_t *p_this ) ...@@ -1716,7 +1718,8 @@ static void CacheLoad( vlc_object_t *p_this )
goto error; \ goto error; \
} \ } \
a = psz; \ a = psz; \
} } \
}
for( i = 0; i < i_cache; i++ ) for( i = 0; i < i_cache; i++ )
{ {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment