X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=modules%2Fdemux%2Fflac.c;h=d2fc0395b826fd234f87ab91451ab7274132f147;hb=132030acbbe9d9d69bed8e1382515a0060e9bf45;hp=53abe8d643e02b3dc702871edcdfd16a5a46a074;hpb=27d483e9ef7a451397d7857251c8d67097661f1d;p=vlc diff --git a/modules/demux/flac.c b/modules/demux/flac.c index 53abe8d643..d2fc0395b8 100644 --- a/modules/demux/flac.c +++ b/modules/demux/flac.c @@ -29,7 +29,7 @@ # include "config.h" #endif -#include +#include #include #include #include @@ -45,7 +45,7 @@ static int Open ( vlc_object_t * ); static void Close ( vlc_object_t * ); vlc_module_begin(); - set_description( _("FLAC demuxer") ); + set_description( N_("FLAC demuxer") ); set_capability( "demux", 155 ); set_category( CAT_INPUT ); set_subcategory( SUBCAT_INPUT_DEMUX ); @@ -620,7 +620,8 @@ static void ParseComment( demux_t *p_demux, const uint8_t *p_data, int i_data ) if( oldval ) \ { \ char * newval; \ - asprintf( &newval, "%s,%s", oldval, &psz[strlen(txt)] ); \ + if( asprintf( &newval, "%s,%s", oldval, &psz[strlen(txt)] ) == -1 ) \ + newval = NULL; \ vlc_meta_Set( p_sys->p_meta, vlc_meta_ ## var, newval ); \ free( newval ); \ } \ @@ -678,17 +679,17 @@ static void ParsePicture( demux_t *p_demux, const uint8_t *p_data, int i_data ) i_type = GetDWBE( p_data ); RM(4); i_len = GetDWBE( p_data ); RM(4); - if( i_data < i_len + 4 ) + if( i_len < 0 || i_data < i_len + 4 ) goto error; psz_mime = strndup( p_data, i_len ); RM(i_len); i_len = GetDWBE( p_data ); RM(4); - if( i_data < i_len + 4*4 + 4) + if( i_len < 0 || i_data < i_len + 4*4 + 4) goto error; psz_description = strndup( p_data, i_len ); RM(i_len); EnsureUTF8( psz_description ); RM(4*4); i_len = GetDWBE( p_data ); RM(4); - if( i_len > i_data ) + if( i_len < 0 || i_len > i_data ) goto error; msg_Dbg( p_demux, "FLAC: Picture type=%d mime=%s description='%s' file length=%d",