[vlc-commits] mp4: avoid assignment as predicate

Rémi Denis-Courmont git at videolan.org
Fri Nov 24 20:54:30 CET 2017


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Thu Nov 23 22:10:33 2017 +0200| [fbb9d1fcbae45844a6f6331cc6322aa200bf26a7] | committer: Rémi Denis-Courmont

mp4: avoid assignment as predicate

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

 modules/demux/mp4/libmp4.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/modules/demux/mp4/libmp4.c b/modules/demux/mp4/libmp4.c
index 53ff41f3cb..4025f196a1 100644
--- a/modules/demux/mp4/libmp4.c
+++ b/modules/demux/mp4/libmp4.c
@@ -529,11 +529,12 @@ static int MP4_ReadBox_ftyp( stream_t *p_stream, MP4_Box_t *p_box )
     MP4_GETFOURCC( p_box->data.p_ftyp->i_major_brand );
     MP4_GET4BYTES( p_box->data.p_ftyp->i_minor_version );
 
-    if( ( p_box->data.p_ftyp->i_compatible_brands_count = i_read / 4 ) )
+    p_box->data.p_ftyp->i_compatible_brands_count = i_read / 4;
+    if( p_box->data.p_ftyp->i_compatible_brands_count > 0 )
     {
         uint32_t *tab = p_box->data.p_ftyp->i_compatible_brands =
-            calloc( p_box->data.p_ftyp->i_compatible_brands_count,
-                    sizeof(uint32_t));
+            vlc_alloc( p_box->data.p_ftyp->i_compatible_brands_count,
+                       sizeof(uint32_t) );
 
         if( unlikely( tab == NULL ) )
             MP4_READBOX_EXIT( 0 );



More information about the vlc-commits mailing list