[libdvdnav-devel] [PATCH 28/33] Use calloc instead of malloc
beandog at gentoo.org
beandog at gentoo.org
Thu Jan 15 21:45:40 CET 2015
From: Steve Dibb <steve.dibb at gmail.com>
---
src/dvd_reader.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/dvd_reader.c b/src/dvd_reader.c
index e22412a..548aa65 100644
--- a/src/dvd_reader.c
+++ b/src/dvd_reader.c
@@ -1322,7 +1322,7 @@ ssize_t DVDReadBytes( dvd_file_t *dvd_file, void *data, size_t byte_size )
numsec = ( ( seek_byte + byte_size ) / DVD_VIDEO_LB_LEN ) +
( ( ( seek_byte + byte_size ) % DVD_VIDEO_LB_LEN ) ? 1 : 0 );
- secbuf_base = malloc( numsec * DVD_VIDEO_LB_LEN + 2048 );
+ secbuf_base = calloc( numsec, DVD_VIDEO_LB_LEN + 2048 );
if( !secbuf_base ) {
fprintf( stderr, "libdvdread: Can't allocate memory "
"for file read!\n" );
--
2.0.4
More information about the libdvdnav-devel
mailing list