[vlc-commits] gme: use vlc_alloc helper

Thomas Guillem git at videolan.org
Sat Nov 11 19:00:08 CET 2017


vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Sat Nov 11 18:44:53 2017 +0100| [5898b149d1dfaeaa17625ca7b43adb15c7cfcd58] | committer: Thomas Guillem

gme: use vlc_alloc helper

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

 modules/demux/gme.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/modules/demux/gme.c b/modules/demux/gme.c
index 0a4d20be6c..ea87412c66 100644
--- a/modules/demux/gme.c
+++ b/modules/demux/gme.c
@@ -131,7 +131,7 @@ static int Open (vlc_object_t *obj)
 
     /* Titles */
     unsigned n = gme_track_count (sys->emu);
-    sys->titlev = malloc (n * sizeof (*sys->titlev));
+    sys->titlev = vlc_alloc (n, sizeof (*sys->titlev));
     if (unlikely(sys->titlev == NULL))
         n = 0;
     sys->titlec = n;
@@ -309,7 +309,7 @@ static int Control (demux_t *demux, int query, va_list args)
             *(va_arg (args, int *)) = 0; /* Chapter offset */
 
             unsigned n = sys->titlec;
-            *titlev = malloc (sizeof (**titlev) * n);
+            *titlev = vlc_alloc (n, sizeof (**titlev));
             if (unlikely(*titlev == NULL))
                 n = 0;
             *titlec = n;



More information about the vlc-commits mailing list