]> git.sesse.net Git - vlc/commitdiff
Remove unneeded msg_Error.
authorRémi Duraffort <ivoire@videolan.org>
Sat, 21 Jun 2008 18:12:25 +0000 (20:12 +0200)
committerRémi Duraffort <ivoire@videolan.org>
Sun, 22 Jun 2008 19:41:15 +0000 (21:41 +0200)
Fix a potential segfault.

modules/access/smb.c
modules/access_output/bonjour.c
modules/access_output/http.c
modules/access_output/shout.c
modules/demux/nsc.c
modules/demux/ts.c
modules/misc/svg.c
modules/misc/win32text.c
modules/packetizer/mpeg4audio.c
modules/packetizer/mpeg4video.c
modules/video_output/msw/events.c

index 86308e5200f10e1c55b775ee5998e54bebff79cb..3f21b6be03afa42b1d92498166db4d5680e2d52b 100644 (file)
@@ -216,7 +216,6 @@ static int Open( vlc_object_t *p_this )
 #ifdef USE_CTX
     if( !(p_smb = smbc_new_context()) )
     {
-        msg_Err( p_access, "out of memory" );
         free( psz_uri );
         return VLC_ENOMEM;
     }
index d02240b3e3497af3b4a4eae14ce95b3827ec06ba..aab2c7051068977f0c2f4736059a635178d8e1a3 100644 (file)
@@ -201,10 +201,7 @@ void *bonjour_start_service( vlc_object_t *p_log, const char *psz_stype,
 
     p_sys = (bonjour_t *)malloc( sizeof(*p_sys) );
     if( p_sys == NULL )
-    {
-        msg_Err( p_log, "out of memory" );
         return NULL;
-    }
 
     memset( p_sys, 0, sizeof(*p_sys) );
 
@@ -214,19 +211,13 @@ void *bonjour_start_service( vlc_object_t *p_log, const char *psz_stype,
     p_sys->psz_name = avahi_strdup( psz_name );
     p_sys->psz_stype = avahi_strdup( psz_stype );
     if( p_sys->psz_name == NULL || p_sys->psz_stype == NULL )
-    {
-        msg_Err( p_sys->p_log, "out of memory" );
         goto error;
-    }
 
     if( psz_txt != NULL )
     {
         p_sys->psz_txt = avahi_strdup( psz_txt );
         if( p_sys->psz_txt == NULL )
-        {
-            msg_Err( p_sys->p_log, "out of memory" );
             goto error;
-        }
     }
 
     p_sys->simple_poll = avahi_simple_poll_new();
@@ -251,10 +242,7 @@ void *bonjour_start_service( vlc_object_t *p_log, const char *psz_stype,
     p_sys->poll_thread = vlc_object_create( p_sys->p_log,
                                             sizeof(poll_thread_t) );
     if( p_sys->poll_thread == NULL )
-    {
-        msg_Err( p_sys->p_log, "out of memory" );
         goto error;
-    }
     p_sys->poll_thread->simple_poll = p_sys->simple_poll;
 
     if( vlc_thread_create( p_sys->poll_thread, "Avahi Poll Iterate Thread",
index 8b9c16bcb4101c949921b2d81f9308a7caa5d214..cdf7bf41b4b7e7ee9fbd3cd117072df51923aac5 100644 (file)
@@ -171,10 +171,7 @@ static int Open( vlc_object_t *p_this )
 
     if( !( p_sys = p_access->p_sys =
                 malloc( sizeof( sout_access_out_sys_t ) ) ) )
-    {
-        msg_Err( p_access, "Not enough memory" );
         return VLC_ENOMEM ;
-    }
 
     config_ChainParse( p_access, SOUT_CFG_PREFIX, ppsz_sout_options, p_access->p_cfg );
 
index e6374aa71a37abbad7843e81fbf277ca26baff54..58171afbcfa3435de32938c10a7de14fdea24c18 100644 (file)
@@ -184,6 +184,8 @@ static int Open( vlc_object_t *p_this )
     config_ChainParse( p_access, SOUT_CFG_PREFIX, ppsz_sout_options, p_access->p_cfg );
 
     psz_accessname = psz_parser = strdup( p_access->psz_path );
+    if( !psz_parser )
+        return VLC_ENOMEM;
 
     if( !p_access->psz_path )
     {
@@ -212,7 +214,6 @@ static int Open( vlc_object_t *p_this )
     p_sys = p_access->p_sys = malloc( sizeof( sout_access_out_sys_t ) );
     if( !p_sys )
     {
-        msg_Err( p_access, "out of memory" );
         free( psz_accessname );
         return VLC_ENOMEM;
     }
index 2c44dcbf34d292895967f0880db10979197c2fb4..c889af9a8e3f321e2a127ec9fd2e043c24649e17 100644 (file)
@@ -213,10 +213,7 @@ static char *nscdec( vlc_object_t *p_demux, char* p_encoded )
     buf16_size = length;
     buf16 = malloc( buf16_size );
     if( buf16 == NULL )
-    {
-        msg_Err( p_demux, "out of memory" );
         return NULL;
-    }
 
     for( i = 0; i < length; i++ )
     {
@@ -232,7 +229,6 @@ static char *nscdec( vlc_object_t *p_demux, char* p_encoded )
     buf8 = malloc( buf8_size + 1 );
     if( buf8 == NULL )
     {
-        msg_Err( p_demux, "out of memory" );
         free( buf16 );
         return NULL;
     }
index a6b0fe9bac6457325b71ba7ffe480b937b8456a8..3dde939403d2280ea3f8383d03eed9bc3c5ef3d7 100644 (file)
@@ -728,7 +728,6 @@ static int Open( vlc_object_t *p_this )
             prg = malloc( sizeof( ts_prg_psi_t ) );
             if( !prg )
             {
-                msg_Err( p_demux, "out of memory" );
                 Close( VLC_OBJECT(p_demux) );
                 return VLC_ENOMEM;
             }
index 9d024a614a2dc8a1053704ee78820b11a41324d9..02ad4e1021551e3dbe30f55e058a98b9eb24ca9f 100644 (file)
@@ -131,16 +131,12 @@ static int Create( vlc_object_t *p_this )
     /* Allocate structure */
     p_sys = malloc( sizeof( filter_sys_t ) );
     if( !p_sys )
-    {
-        msg_Err( p_filter, "out of memory" );
         return VLC_ENOMEM;
-    }
 
     /* Initialize psz_template */
     p_sys->psz_template = svg_GetTemplate( p_this );
     if( !p_sys->psz_template )
     {
-        msg_Err( p_filter, "out of memory" );
         free( p_sys );
         return VLC_ENOMEM;
     }
@@ -204,10 +200,7 @@ static char *svg_GetTemplate( vlc_object_t *p_this )
 
                 psz_template = malloc( ( s.st_size + 42 ) * sizeof( char ) );
                 if( !psz_template )
-                {
-                    msg_Err( p_filter, "out of memory" );
                     return NULL;
-                }
                 memset( psz_template, 0, s.st_size + 1 );
                 fread( psz_template, s.st_size, 1, file );
                 fclose( file );
@@ -451,10 +444,7 @@ static int RenderText( filter_t *p_filter, subpicture_region_t *p_region_out,
 
     p_svg = ( svg_rendition_t * )malloc( sizeof( svg_rendition_t ) );
     if( !p_svg )
-    {
-        msg_Err( p_filter, "out of memory" );
         return VLC_ENOMEM;
-    }
 
     p_region_out->i_x = p_region_in->i_x;
     p_region_out->i_y = p_region_in->i_y;
@@ -467,7 +457,6 @@ static int RenderText( filter_t *p_filter, subpicture_region_t *p_region_out,
         p_svg->psz_text = strdup( psz_string );
         if( !p_svg->psz_text )
         {
-            msg_Err( p_filter, "out of memory" );
             free( p_svg );
             return VLC_ENOMEM;
         }
@@ -482,7 +471,6 @@ static int RenderText( filter_t *p_filter, subpicture_region_t *p_region_out,
         p_svg->psz_text = malloc( ( length + 1 ) * sizeof( char ) );
         if( !p_svg->psz_text )
         {
-            msg_Err( p_filter, "out of memory" );
             free( p_svg );
             return VLC_ENOMEM;
         }
index 98a7d878bd125d04206dcec6ef9ed6e56d99276b..6318570ffd0a541290394aebdfc0b457119a63d5 100644 (file)
@@ -151,10 +151,7 @@ static int Create( vlc_object_t *p_this )
     /* Allocate structure */
     p_filter->p_sys = p_sys = malloc( sizeof( filter_sys_t ) );
     if( !p_sys )
-    {
-        msg_Err( p_filter, "out of memory" );
         return VLC_ENOMEM;
-    }
     p_sys->i_font_size = 0;
     p_sys->i_display_height = 0;
 
index 2202bbfa6cf370dac5d989ca73a20a30bbd8d3c8..9a926acdd28123909cb58d7fdf12cb4f2ca4876e 100644 (file)
@@ -203,10 +203,7 @@ static int OpenPacketizer( vlc_object_t *p_this )
     /* Allocate the memory needed to store the decoder's structure */
     if( ( p_dec->p_sys = p_sys =
           (decoder_sys_t *)malloc(sizeof(decoder_sys_t)) ) == NULL )
-    {
-        msg_Err( p_dec, "out of memory" );
-        return VLC_EGENERIC;
-    }
+        return VLC_ENOMEM;
 
     /* Misc init */
     p_sys->i_state = STATE_NOSYNC;
index 95c72e6e2549dabea690ee94daf25291b06573ea..449ec36d08337c5988627a3b8cc44d62198ac0e1 100644 (file)
@@ -160,10 +160,7 @@ static int Open( vlc_object_t *p_this )
 
     /* Allocate the memory needed to store the decoder's structure */
     if( ( p_dec->p_sys = p_sys = malloc( sizeof(decoder_sys_t) ) ) == NULL )
-    {
-        msg_Err( p_dec, "out of memory" );
-        return VLC_EGENERIC;
-    }
+        return VLC_ENOMEM;
     memset( p_sys, 0, sizeof(decoder_sys_t) );
 
     /* Misc init */
index 5467ca5fdd5a8d5562421fc61a1341dd88ea75bf..5a4eecd5ce899f6831b68d2a0ba8bea3b105a288 100644 (file)
@@ -113,10 +113,7 @@ void EventThread( event_thread_t *p_event )
     /* Creating a window under Windows also initializes the thread's event
      * message queue */
     if( DirectXCreateWindow( p_event->p_vout ) )
-    {
-        msg_Err( p_event, "out of memory" );
         p_event->b_dead = true;
-    }
 
     /* Signal the creation of the window */
     vlc_thread_ready( p_event );