[libdvdnav-devel] [PATCH 20/33] Use calloc as a safety measure since ifoRead functions populate parts of the data independently

beandog at gentoo.org beandog at gentoo.org
Thu Jan 15 21:45:32 CET 2015


From: Steve Dibb <steve.dibb at gmail.com>

---
 src/ifo_read.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/ifo_read.c b/src/ifo_read.c
index d953f3b..6b1a0cf 100644
--- a/src/ifo_read.c
+++ b/src/ifo_read.c
@@ -605,7 +605,7 @@ void ifoClose(ifo_handle_t *ifofile) {
 static int ifoRead_VMG(ifo_handle_t *ifofile) {
   vmgi_mat_t *vmgi_mat;
 
-  vmgi_mat = malloc(sizeof(vmgi_mat_t));
+  vmgi_mat = calloc(1, sizeof(vmgi_mat_t));
   if(!vmgi_mat)
     return 0;
 
-- 
2.0.4



More information about the libdvdnav-devel mailing list