[h5py] 206/455: Extra checks for LZF filter

Ghislain Vaillant ghisvail-guest at moszumanska.debian.org
Thu Jul 2 18:19:33 UTC 2015


This is an automated email from the git hooks/post-receive script.

ghisvail-guest pushed a commit to annotated tag 1.3.0
in repository h5py.

commit 04101064aa863f46f0efa11af7ad8618416f2e00
Author: andrewcollette <andrew.collette at gmail.com>
Date:   Wed Jan 28 09:50:43 2009 +0000

    Extra checks for LZF filter
---
 h5py/lzf_filter.c | 22 ++++++++++------------
 1 file changed, 10 insertions(+), 12 deletions(-)

diff --git a/h5py/lzf_filter.c b/h5py/lzf_filter.c
index a662f55..c382951 100644
--- a/h5py/lzf_filter.c
+++ b/h5py/lzf_filter.c
@@ -82,18 +82,6 @@ int register_lzf(void){
     return retval;
 }
 
-void printbytes(char *buffer, int nbytes){
-
-    int i;
-    char c;
-    for(i=0; i<nbytes; i++){
-        c = buffer[i];
-        fprintf(stderr, "%03u ", c);
-        if(i%20==0){
-            fprintf(stderr, "\n");
-        }
-    }
-}
 /* The filter function */
 size_t lzf_filter(unsigned flags, size_t cd_nelmts,
 		    const unsigned cd_values[], size_t nbytes,
@@ -116,6 +104,11 @@ size_t lzf_filter(unsigned flags, size_t cd_nelmts,
         outbuf_size = nbytes;
         outbuf = malloc(outbuf_size);
 
+        if(outbuf == NULL){
+            PUSH_ERR("lzf_filter", H5E_CALLBACK, "Can't allocate compression buffer");
+            goto failed;
+        }
+
         status = lzf_compress(*buf, nbytes, outbuf, outbuf_size);
 
     /* We're decompressing */
@@ -128,6 +121,11 @@ size_t lzf_filter(unsigned flags, size_t cd_nelmts,
             free(outbuf);
             outbuf = malloc(outbuf_size);
 
+            if(outbuf == NULL){
+                PUSH_ERR("lzf_filter", H5E_CALLBACK, "Can't allocate decompression buffer");
+                goto failed;
+            }
+
             status = lzf_decompress(*buf, nbytes, outbuf, outbuf_size);
 
             /* compression failed */

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/h5py.git



More information about the debian-science-commits mailing list