]> git.sesse.net Git - vlc/blobdiff - modules/stream_out/mosaic_bridge.c
Remove useless test before free and delete.
[vlc] / modules / stream_out / mosaic_bridge.c
index c025744b5328573071e11b26942d7bf95d65ecbb..d9790bc7860bf0a11bff8df2f4c35577aa142627 100644 (file)
@@ -86,8 +86,11 @@ static void ReleasePicture( picture_t *p_pic )
         }
         else
         {
-            if( p_pic && p_pic->p_data_orig ) free( p_pic->p_data_orig );
-            if( p_pic ) free( p_pic );
+            if( p_pic )
+            {
+                free( p_pic->p_data_orig );
+                free( p_pic );
+            }
         }
     }
 }
@@ -262,8 +265,7 @@ static void Close( vlc_object_t * p_this )
 
     p_stream->p_sout->i_out_pace_nocontrol--;
 
-    if ( p_sys->psz_id )
-        free( p_sys->psz_id );
+    free( p_sys->psz_id );
 
     free( p_sys );
 }
@@ -454,8 +456,7 @@ static int Del( sout_stream_t *p_stream, sout_stream_id_t *id )
         {
             if ( pp_ring[i] != NULL )
             {
-                if ( pp_ring[i]->p_data_orig != NULL )
-                    free( pp_ring[i]->p_data_orig );
+                free( pp_ring[i]->p_data_orig );
                 free( pp_ring[i]->p_sys );
                 free( pp_ring[i] );
             }
@@ -742,8 +743,7 @@ static picture_t *video_new_buffer( vlc_object_t *p_this,
             {
                 if ( pp_ring[i]->i_status == DESTROYED_PICTURE )
                 {
-                    if ( pp_ring[i]->p_data_orig != NULL )
-                        free( pp_ring[i]->p_data_orig );
+                    free( pp_ring[i]->p_data_orig );
                     free( pp_ring[i]->p_sys );
                     free( pp_ring[i] );
                 }
@@ -784,6 +784,7 @@ static picture_t *video_new_buffer( vlc_object_t *p_this,
     }
 
     p_pic = malloc( sizeof(picture_t) );
+    if( !p_pic ) return NULL;
     fmt_out->video.i_chroma = fmt_out->i_codec;
     vout_AllocatePicture( p_this, p_pic,
                           fmt_out->video.i_chroma,
@@ -828,8 +829,7 @@ static void video_del_buffer( picture_t *p_pic )
     p_pic->i_status = DESTROYED_PICTURE;
     if ( p_pic->p_sys->b_dead )
     {
-        if ( p_pic->p_data_orig != NULL )
-            free( p_pic->p_data_orig );
+        free( p_pic->p_data_orig );
         free( p_pic->p_sys );
         free( p_pic );
     }