return VLC_FOURCC( p_buff[0], p_buff[1], p_buff[2], p_buff[3] );
}
-#define AVI_ChunkFree( a, b ) _AVI_ChunkFree( (a), (avi_chunk_t*)(b) )
-void _AVI_ChunkFree( stream_t *, avi_chunk_t *p_chk );
-
/****************************************************************************
*
* Basics functions to manipulates chunks
#define AVI_READCHUNK_ENTER \
int64_t i_read = __EVEN(p_chk->common.i_chunk_size ) + 8; \
+ if( i_read > 100000000 ) \
+ { \
+ msg_Err( s, "Big chunk ignored" ); \
+ return VLC_EGENERIC; \
+ } \
uint8_t *p_read, *p_buff; \
if( !( p_read = p_buff = malloc(i_read ) ) ) \
{ \
avi_chunk_t *p_child;
char str[512];
- if( i_level * 5 + 1 >= sizeof(str) )
+ if( i_level >= (sizeof(str) - 1)/5 )
return;
memset( str, ' ', sizeof( str ) );