if( (i_read > 0) && (p_peek[0]) ) \
{ \
const int __i_copy__ = strnlen( (char*)p_peek, i_read-1 ); \
- p_str = calloc( sizeof(char), __i_copy__+1 ); \
+ p_str = malloc( __i_copy__+1 ); \
if( __i_copy__ > 0 ) memcpy( p_str, p_peek, __i_copy__ ); \
p_str[__i_copy__] = 0; \
p_peek += __i_copy__ + 1; \
/* made by 0xXXXXXXXX-0011-0010-8000-00aa00389b71
where XXXXXXXX is the fourcc */
/* FIXME implement this */
+ (void)p_uuid;
+ (void)i_fourcc;
}
/* some functions for mp4 encoding of variables */
static void MP4_FreeBox_Common( MP4_Box_t *p_box )
{
/* Up to now do nothing */
+ (void)p_box;
}
static int MP4_ReadBoxSkip( stream_t *p_stream, MP4_Box_t *p_box )
if( i_read > 0 )
{
- p_box->data.p_hdlr->psz_name = calloc( sizeof( char ), i_read + 1 );
+ p_box->data.p_hdlr->psz_name = malloc( i_read + 1 );
/* Yes, I love .mp4 :( */
if( p_box->data.p_hdlr->i_predefined == VLC_FOURCC( 'm', 'h', 'l', 'r' ) )
unsigned int i_len;
MP4_GET1BYTE( i_len );
- es_descriptor.psz_URL = calloc( sizeof(char), i_len + 1 );
+ es_descriptor.psz_URL = malloc( i_len + 1 );
memcpy( es_descriptor.psz_URL, p_peek, i_len );
es_descriptor.psz_URL[i_len] = 0;
p_peek += i_len;
if( p_drms_box && p_drms_box->data.p_sample_soun->p_drms )
{
- int i_ret;
- if( config_GetInt( p_stream, "france" ) )
- {
- i_ret = -7;
- }
- else
- {
- i_ret= drms_init( p_drms_box->data.p_sample_soun->p_drms,
+ int i_ret = drms_init( p_drms_box->data.p_sample_soun->p_drms,
p_box->i_type, p_peek, i_read );
- }
if( i_ret )
{
const char *psz_error;
case -4: psz_error = "could not get SCI data"; break;
case -5: psz_error = "no user key found in SCI data"; break;
case -6: psz_error = "invalid user key"; break;
- case -7: psz_error = "you live in France"; break;
default: psz_error = "unknown error"; break;
}
if MP4_BOX_TYPE_ASCII()
/**** "Higher level" Functions ****/
/**** ------------------------------------------------------------------- ****/
-static struct
+static const struct
{
uint32_t i_type;
int (*MP4_ReadBox_function )( stream_t *p_stream, MP4_Box_t *p_box );
return;
}
- vasprintf( &psz_path, psz_fmt, args );
+ if( vasprintf( &psz_path, psz_fmt, args ) == -1 )
+ psz_path = NULL;
if( !psz_path || !psz_path[0] )
{