[vlc-commits] picture: remove no-op

Rémi Denis-Courmont git at videolan.org
Sun Feb 11 09:17:08 CET 2018


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sat Feb 10 11:59:21 2018 +0200| [401bef8edf6f3e90eb245e3a6e3f1abc587359ec] | committer: Rémi Denis-Courmont

picture: remove no-op

The unallocated picture will be destroyed immediately by the caller.
Setting the planes count to zero has no effects.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=401bef8edf6f3e90eb245e3a6e3f1abc587359ec
---

 src/misc/picture.c | 11 -----------
 1 file changed, 11 deletions(-)

diff --git a/src/misc/picture.c b/src/misc/picture.c
index 62edbc8434..a35ff0ff15 100644
--- a/src/misc/picture.c
+++ b/src/misc/picture.c
@@ -57,33 +57,22 @@ static int AllocatePicture( picture_t *p_pic )
 
         if( p->i_pitch < 0 || p->i_lines <= 0 ||
             (size_t)p->i_pitch > (SIZE_MAX - i_bytes)/p->i_lines )
-        {
-            p_pic->i_planes = 0;
             return VLC_ENOMEM;
-        }
         i_bytes += p->i_pitch * p->i_lines;
     }
 
     if( i_bytes >= PICTURE_SW_SIZE_MAX )
-    {
-        p_pic->i_planes = 0;
         return VLC_ENOMEM;
-    }
 
     uint8_t *p_data = aligned_alloc( 16, i_bytes );
     if( i_bytes > 0 && p_data == NULL )
-    {
-        p_pic->i_planes = 0;
         return VLC_EGENERIC;
-    }
 
     /* Fill the p_pixels field for each plane */
     p_pic->p[0].p_pixels = p_data;
     for( int i = 1; i < p_pic->i_planes; i++ )
-    {
         p_pic->p[i].p_pixels = &p_pic->p[i-1].p_pixels[ p_pic->p[i-1].i_lines *
                                                         p_pic->p[i-1].i_pitch ];
-    }
 
     return VLC_SUCCESS;
 }



More information about the vlc-commits mailing list