[vlc-commits] zip: Check malloc return.
Hugo Beauzée-Luyssen
git at videolan.org
Mon Apr 16 10:43:04 CEST 2012
vlc | branch: master | Hugo Beauzée-Luyssen <beauze.h at gmail.com> | Thu Apr 12 14:07:57 2012 +0200| [49df02459eae84b3acc839d3a1c953b89c660f23] | committer: Hugo Beauzée-Luyssen
zip: Check malloc return.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=49df02459eae84b3acc839d3a1c953b89c660f23
---
modules/access/zip/zipaccess.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/modules/access/zip/zipaccess.c b/modules/access/zip/zipaccess.c
index 45fbed9..8e0341a 100644
--- a/modules/access/zip/zipaccess.c
+++ b/modules/access/zip/zipaccess.c
@@ -326,6 +326,8 @@ static int AccessSeek( access_t *p_access, uint64_t seek_len )
unsigned i_seek = 0;
int i_read = 1;
char *p_buffer = ( char* ) calloc( 1, ZIP_BUFFER_LEN );
+ if( unlikely( !p_buffer ) )
+ return VLC_EGENERIC;
while( ( i_seek < seek_len ) && ( i_read > 0 ) )
{
i_read = ( seek_len - i_seek < ZIP_BUFFER_LEN )
More information about the vlc-commits
mailing list