Changeset 37a2578ce4265f4ed495290923e3fa674c662656

Show
Ignore:
Timestamp:
22/06/08 22:05:09 (5 months ago)
Author:
Rémi Duraffort <ivoire@videolan.org>
git-committer:
Rémi Duraffort <ivoire@videolan.org> 1214165109 +0200
git-parent:

[172e22c2f2b4abbdfee50d9fe8aaaede4b405c76]

git-author:
Rémi Duraffort <ivoire@videolan.org> 1214165109 +0200
Message:

Remove unneeded msg_Err.
Fix potential segfault (check malloc return value).

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • modules/audio_output/alsa.c

    r3561b9b r37a2578  
    314314    p_aout->output.p_sys = p_sys = malloc( sizeof( aout_sys_t ) ); 
    315315    if( p_sys == NULL ) 
    316     { 
    317         msg_Err( p_aout, "out of memory" ); 
    318316        return VLC_ENOMEM; 
    319     } 
    320317    p_sys->b_playing = false; 
    321318    p_sys->start_date = 0; 
  • modules/audio_output/arts.c

    r3561b9b r37a2578  
    8484    p_sys = malloc( sizeof( aout_sys_t ) ); 
    8585    if( p_sys == NULL ) 
    86     { 
    87         msg_Err( p_aout, "out of memory" ); 
    8886        return VLC_ENOMEM; 
    89     } 
    9087    p_aout->output.p_sys = p_sys; 
    9188 
  • modules/audio_output/auhal.c

    r3561b9b r37a2578  
    162162    p_aout->output.p_sys = malloc( sizeof( aout_sys_t ) ); 
    163163    if( p_aout->output.p_sys == NULL ) 
    164     { 
    165         msg_Err( p_aout, "out of memory" ); 
    166         return( VLC_ENOMEM ); 
    167     } 
     164        return VLC_ENOMEM; 
    168165 
    169166    p_sys = p_aout->output.p_sys; 
     
    650647    p_streams = (AudioStreamID *)malloc( i_param_size ); 
    651648    if( p_streams == NULL ) 
    652     { 
    653         msg_Err( p_aout, "out of memory" ); 
    654         return false; 
    655     } 
     649        return false; 
    656650  
    657651    err = AudioDeviceGetProperty( p_sys->i_selected_dev, 0, FALSE, 
     
    686680        p_format_list = (AudioStreamBasicDescription *)malloc( i_param_size ); 
    687681        if( p_format_list == NULL ) 
    688         { 
    689             msg_Err( p_aout, "could not malloc the memory" ); 
    690682            continue; 
    691         } 
    692683  
    693684        err = AudioStreamGetProperty( p_streams[i], 0, 
     
    952943    p_devices = (AudioDeviceID*)malloc( sizeof(AudioDeviceID) * p_sys->i_devices ); 
    953944    if( p_devices == NULL ) 
    954     { 
    955         msg_Err( p_aout, "out of memory" ); 
    956945        goto error; 
    957     } 
    958946 
    959947    /* Populate DeviceID array */ 
     
    11021090    p_streams = (AudioStreamID *)malloc( i_param_size ); 
    11031091    if( p_streams == NULL ) 
    1104     { 
    1105         msg_Err( p_aout, "out of memory" ); 
    11061092        return VLC_ENOMEM; 
    1107     } 
    11081093  
    11091094    err = AudioDeviceGetProperty( i_dev_id, 0, FALSE, 
     
    11511136    p_format_list = (AudioStreamBasicDescription *)malloc( i_param_size ); 
    11521137    if( p_format_list == NULL ) 
    1153     { 
    1154         msg_Err( p_aout, "could not malloc the memory" ); 
    1155         return false; 
    1156     } 
     1138        return false; 
    11571139  
    11581140    err = AudioStreamGetProperty( i_stream_id, 0, 
  • modules/audio_output/directx.c

    r3561b9b r37a2578  
    255255    p_aout->output.p_sys = malloc( sizeof( aout_sys_t ) ); 
    256256    if( p_aout->output.p_sys == NULL ) 
    257     { 
    258         msg_Err( p_aout, "out of memory" ); 
    259257        return VLC_ENOMEM; 
    260     } 
    261258 
    262259    /* Initialize some variables */ 
  • modules/audio_output/esd.c

    r3561b9b r37a2578  
    9292    p_sys = malloc( sizeof( aout_sys_t ) ); 
    9393    if( p_sys == NULL ) 
    94     { 
    95         msg_Err( p_aout, "out of memory" ); 
    9694        return VLC_ENOMEM; 
    97     } 
    9895 
    9996    p_aout->output.p_sys = p_sys; 
  • modules/audio_output/file.c

    r3561b9b r37a2578  
    155155    p_aout->output.p_sys = malloc( sizeof( aout_sys_t ) ); 
    156156    if( p_aout->output.p_sys == NULL ) 
    157     { 
    158         msg_Err( p_aout, "out of memory" ); 
    159         return VLC_EGENERIC; 
    160     } 
     157        return VLC_ENOMEM; 
    161158 
    162159    if( !strcmp( psz_name, "-" ) ) 
  • modules/audio_output/hd1000a.cpp

    r3561b9b r37a2578  
    9898        (aout_sys_t *)malloc( sizeof( aout_sys_t ) ); 
    9999    if( p_aout->output.p_sys == NULL ) 
    100     { 
    101         msg_Err( p_aout, "out of memory" ); 
    102         return VLC_EGENERIC; 
    103     } 
     100        return VLC_ENOMEM; 
    104101 
    105102    /* New PCMAudioPlayer */ 
     
    107104    if( p_sys->pPlayer == NULL ) 
    108105    { 
    109         msg_Err( p_aout, "out of memory" ); 
    110         free( p_sys ); 
    111         return VLC_EGENERIC; 
     106        free( p_sys ); 
     107        return VLC_ENOMEM; 
    112108    } 
    113109 
     
    128124    if( p_sys->ppBuffers == NULL ) 
    129125    { 
    130         msg_Err( p_aout, "out of memory" ); 
    131         delete pPlayer; 
    132         free( p_sys ); 
    133         return VLC_EGENERIC; 
     126        delete pPlayer; 
     127        free( p_sys ); 
     128        return VLC_ENOMEM; 
    134129    } 
    135130 
  • modules/audio_output/jack.c

    r3561b9b r37a2578  
    109109    if( p_sys == NULL ) 
    110110    { 
    111         msg_Err( p_aout, "out of memory" ); 
    112111        status = VLC_ENOMEM; 
    113112        goto error_out; 
     
    144143    if( p_sys->p_jack_ports == NULL ) 
    145144    { 
    146         msg_Err( p_aout, "out of memory" ); 
    147145        status = VLC_ENOMEM; 
    148146        goto error_out; 
     
    153151    if( p_sys->p_jack_buffers == NULL ) 
    154152    { 
    155         msg_Err( p_aout, "out of memory" ); 
    156153        status = VLC_ENOMEM; 
    157154        goto error_out; 
  • modules/audio_output/oss.c

    r3561b9b r37a2578  
    280280    p_aout->output.p_sys = p_sys = malloc( sizeof( aout_sys_t ) ); 
    281281    if( p_sys == NULL ) 
    282     { 
    283         msg_Err( p_aout, "out of memory" ); 
    284282        return VLC_ENOMEM; 
    285     } 
    286283 
    287284    /* Get device name */ 
  • modules/audio_output/portaudio.c

    r3561b9b r37a2578  
    182182    p_sys = (aout_sys_t *)malloc( sizeof(aout_sys_t) ); 
    183183    if( p_sys == NULL ) 
    184     { 
    185         msg_Err( p_aout, "out of memory" ); 
    186184        return VLC_ENOMEM; 
    187     } 
    188185    p_sys->p_aout = p_aout; 
    189186    p_sys->p_stream = 0; 
  • modules/audio_output/waveout.c

    r3561b9b r37a2578  
    246246 
    247247    if( p_aout->output.p_sys == NULL ) 
    248     { 
    249         msg_Err( p_aout, "out of memory" ); 
    250         return VLC_EGENERIC; 
    251     } 
     248        return VLC_ENOMEM; 
    252249 
    253250    p_aout->output.pf_play = Play; 
     
    412409    { 
    413410        free( p_aout->output.p_sys ); 
    414         msg_Err( p_aout, "out of memory" ); 
    415411        return 1; 
    416412    } 
  • modules/codec/avcodec/audio.c

    rf7d5f3e r37a2578  
    101101          (decoder_sys_t *)malloc(sizeof(decoder_sys_t)) ) == NULL ) 
    102102    { 
    103         msg_Err( p_dec, "out of memory" ); 
    104103        return VLC_ENOMEM; 
    105104    } 
     
    140139            malloc( p_sys->p_context->extradata_size + 
    141140                    FF_INPUT_BUFFER_PADDING_SIZE ); 
    142         memcpy( p_sys->p_context->extradata, 
    143                 (char*)p_dec->fmt_in.p_extra + i_offset, 
    144                 p_sys->p_context->extradata_size ); 
    145         memset( (char*)p_sys->p_context->extradata + 
    146                 p_sys->p_context->extradata_size, 0, 
    147                 FF_INPUT_BUFFER_PADDING_SIZE ); 
     141        if( p_sys->p_context->extradata ) 
     142        { 
     143            memcpy( p_sys->p_context->extradata, 
     144                    (char*)p_dec->fmt_in.p_extra + i_offset, 
     145                    p_sys->p_context->extradata_size ); 
     146            memset( (char*)p_sys->p_context->extradata + 
     147                    p_sys->p_context->extradata_size, 0, 
     148                    FF_INPUT_BUFFER_PADDING_SIZE ); 
     149        } 
    148150    } 
    149151    else 
  • modules/codec/avcodec/deinterlace.c

    rf7d5f3e r37a2578  
    8585          (filter_sys_t *)malloc(sizeof(filter_sys_t)) ) == NULL ) 
    8686    { 
    87         msg_Err( p_filter, "out of memory" ); 
    8887        return VLC_EGENERIC; 
    8988    } 
  • modules/codec/avcodec/encoder.c

    r2aa6ed9 r37a2578  
    254254    /* Allocate the memory needed to store the encoder's structure */ 
    255255    if( ( p_sys = (encoder_sys_t *)malloc(sizeof(encoder_sys_t)) ) == NULL ) 
    256     { 
    257         msg_Err( p_enc, "out of memory" ); 
    258         return VLC_EGENERIC; 
    259     } 
     256        return VLC_ENOMEM; 
    260257    memset( p_sys, 0, sizeof(encoder_sys_t) ); 
    261258    p_enc->p_sys = p_sys; 
  • modules/codec/avcodec/video.c

    re384ccd r37a2578  
    233233          (decoder_sys_t *)malloc(sizeof(decoder_sys_t)) ) == NULL ) 
    234234    { 
    235         msg_Err( p_dec, "out of memory" ); 
    236235        return VLC_ENOMEM; 
    237236    } 
  • modules/codec/cmml/cmml.c

    r3561b9b r37a2578  
    109109          (decoder_sys_t *)malloc(sizeof(decoder_sys_t)) ) == NULL ) 
    110110    { 
    111         msg_Err( p_dec, "out of memory" ); 
    112111        return VLC_EGENERIC; 
    113112    } 
  • modules/codec/dmo/dmo.c

    r3561b9b r37a2578  
    521521          (decoder_sys_t *)malloc(sizeof(decoder_sys_t)) ) == NULL ) 
    522522    { 
    523         msg_Err( p_dec, "out of memory" ); 
    524523        goto error; 
    525524    } 
     
    13421341          (encoder_sys_t *)malloc(sizeof(encoder_sys_t)) ) == NULL ) 
    13431342    { 
    1344         msg_Err( p_enc, "out of memory" ); 
    13451343        goto error; 
    13461344    } 
  • modules/codec/dvbsub.c

    r3561b9b r37a2578  
    16651665    /* Allocate the memory needed to store the decoder's structure */ 
    16661666    if( ( p_sys = (encoder_sys_t *)malloc(sizeof(encoder_sys_t)) ) == NULL ) 
    1667     { 
    1668         msg_Err( p_enc, "out of memory" ); 
    16691667        return VLC_ENOMEM; 
    1670     } 
    16711668    p_enc->p_sys = p_sys; 
    16721669 
  • modules/codec/subtitles/subsdec.c

    r5e15258 r37a2578  
    161161    p_dec->p_sys = p_sys = malloc( sizeof( *p_sys ) ); 
    162162    if( p_sys == NULL ) 
    163     { 
    164         msg_Err( p_dec, "out of memory" ); 
    165163        return VLC_ENOMEM; 
    166     } 
    167164 
    168165    /* init of p_sys */ 
  • modules/codec/subtitles/subsusf.c

    recbf636 r37a2578  
    8080          (decoder_sys_t *)calloc(1, sizeof(decoder_sys_t)) ) == NULL ) 
    8181    { 
    82         msg_Err( p_dec, "out of memory" ); 
    8382        return VLC_ENOMEM; 
    8483    } 
     
    401400        if( ! p_text_region->psz_html ) 
    402401        { 
    403             msg_Err( p_dec, "out of memory" ); 
    404402            p_spu->pf_destroy_region( VLC_OBJECT(p_dec), p_text_region ); 
    405403            return NULL; 
     
    650648                    if( ! p_style ) 
    651649                    { 
    652                         msg_Err( p_dec, "out of memory" ); 
    653650                        free( psz_node ); 
    654651                        break; 
  • modules/demux/avi/avi.c

    r080410c r37a2578  
    357357        avi_track_t           *tk     = malloc( sizeof( avi_track_t ) ); 
    358358        if( !tk ) 
    359         { 
    360             msg_Err( p_demux, "Out of memory" ); 
    361359            goto error; 
    362         } 
    363360 
    364361        avi_chunk_list_t      *p_strl = AVI_ChunkFind( p_hdrl, AVIFOURCC_strl, i ); 
  • modules/demux/mjpeg.c

    r3561b9b r37a2578  
    157157    } 
    158158    p_line = malloc( i + 1 ); 
    159     if( NULL == p_line ) 
    160     { 
    161         msg_Err( p_demux, "out of memory" ); 
     159    if( p_line == NULL ) 
    162160        return NULL; 
    163     } 
    164161    strncpy ( p_line, (char*)p_buf, i ); 
    165162    p_line[i] = '\0'; 
  • modules/demux/playlist/xspf.c

    r3597618 r37a2578  
    546546                                   strlen(psz_uri) +1 ); 
    547547                           if( !psz_tmp ) 
    548                            { 
    549                                msg_Err( p_demux, "out of memory"); 
    550548                               return false; 
    551                            } 
    552549                           sprintf( psz_tmp, "%s%s", 
    553550                                    p_demux->p_sys->psz_base, psz_uri ); 
  • modules/demux/subtitle.c

    r3561b9b r37a2578  
    450450                                              sizeof(subtitle_t) * i_max ) ) ) 
    451451            { 
    452                 msg_Err( p_demux, "out of memory"); 
    453452                free( p_sys->subtitle ); 
    454453                TextUnload( &p_sys->txt ); 
  • modules/demux/subtitle_asa.c

    r3561b9b r37a2578  
    141141    p_demux->pf_control = Control; 
    142142    p_demux->p_sys = p_sys = malloc( sizeof( demux_sys_t ) ); 
     143    if( !p_sys  ) 
     144        return VLC_ENOMEM; 
    143145    p_sys->psz_header         = NULL; 
    144146    p_sys->i_subtitle         = 0; 
     
    221223    if( !p_data ) 
    222224    { 
    223         msg_Err( p_demux, "out of memory"); 
    224225        free( p_sys ); 
    225226        return VLC_ENOMEM; 
     
    282283                                          * p_sys->i_subs_alloc ) ) ) 
    283284        { 
    284             msg_Err( p_demux, "out of memory"); 
    285285            return VLC_ENOMEM; 
    286286        }