[Git][debian-gis-team/snaphu][upstream] New upstream version 2.0.7

Antonio Valentino (@antonio.valentino) gitlab at salsa.debian.org
Thu Mar 28 09:13:01 GMT 2024



Antonio Valentino pushed to branch upstream at Debian GIS Project / snaphu


Commits:
0b57d0a6 by Antonio Valentino at 2024-03-28T08:26:39+00:00
New upstream version 2.0.7
- - - - -


6 changed files:

- README
- README_releasenotes.txt
- src/Makefile
- src/snaphu.h
- src/snaphu_tile.c
- src/snaphu_util.c


Changes:

=====================================
README
=====================================
@@ -1,7 +1,7 @@
 SNAPHU
 Statistical-Cost, Netowrk-Flow Algorithm for Phase Unwrapping
 Author: Curtis W. Chen
-Version 2.0.6, April 2023
+Version 2.0.7, February 25, 2024
 
 
 Contents
@@ -71,7 +71,7 @@ accept.
 Copyright
 ---------
 
-Copyright 2002-2023 Board of Trustees, Leland Stanford Jr. University
+Copyright 2002-2024 Board of Trustees, Leland Stanford Jr. University
 
 Except as noted below, permission to use, copy, modify, and
 distribute, this software and its documentation for any purpose is


=====================================
README_releasenotes.txt
=====================================
@@ -1,3 +1,10 @@
+Notable changes in v2.0.7 since v2.0.6:
+---------------------------------------
+
+* Fix bug that causes "out of memory" error when when there are no
+  connected components in the first two tiles.
+
+
 Notable changes in v2.0.6 since v2.0.5:
 ---------------------------------------
 


=====================================
src/Makefile
=====================================
@@ -16,7 +16,7 @@
 CC		=	cc
 OPTIMFLAGS	=	-O3
 DEBUGFLAGS	=	-ggdb
-CFLAGS		=	$(OPTIMFLAGS) -Wall # -Wuninitialized -m64 -D NO_CS2
+CFLAGS		=	-arch x86_64 $(OPTIMFLAGS) -Wall # -arch arm64 -Wuninitialized -m64 -D NO_CS2
 LIBS		=	-lm 
 BINDIR		=	../bin
 INSTALLDIR	=	/usr/local/bin


=====================================
src/snaphu.h
=====================================
@@ -14,7 +14,7 @@
 /**********************/
 
 #define PROGRAMNAME          "snaphu"
-#define VERSION              "2.0.6"
+#define VERSION              "2.0.7"
 #define BUGREPORTEMAIL       "snaphu at gmail.com"
 #ifdef PI
 #undef PI


=====================================
src/snaphu_tile.c
=====================================
@@ -4112,10 +4112,12 @@ int AssembleTileConnComps(long linelen, long nlines,
 
           /* get more memory for full set of connected components sizes */
           nmemold=nconncompmem;
-          nconncompmem+=ntileconncomp;
-          conncompsizes=(conncompsizeT *)ReAlloc(conncompsizes,
-                                                 (nconncompmem
-                                                  *sizeof(conncompsizeT)));
+          if(ntileconncomp>0){
+            nconncompmem+=ntileconncomp;
+            conncompsizes=(conncompsizeT *)ReAlloc(conncompsizes,
+                                                   (nconncompmem
+                                                    *sizeof(conncompsizeT)));
+          }
 
           /* store conncomp sizes from tile in full list */
           for(k=0;k<ntileconncompmem;k++){


=====================================
src/snaphu_util.c
=====================================
@@ -522,6 +522,9 @@ void *MAlloc(size_t size){
 
   void *ptr;
 
+  if(size==0){
+    return(NULL);
+  }
   if((ptr=malloc(size))==NULL){
     fflush(NULL);
     fprintf(sp0,"Out of memory\n");
@@ -539,6 +542,9 @@ void *CAlloc(size_t nitems, size_t size){
   
   void *ptr;
   
+  if(size==0){
+    return(NULL);
+  }
   if((ptr=calloc(nitems,size))==NULL){
     fflush(NULL);
     fprintf(sp0,"Out of memory\n");
@@ -555,7 +561,13 @@ void *CAlloc(size_t nitems, size_t size){
 void *ReAlloc(void *ptr, size_t size){
   
   void *ptr2;
-  
+
+  if(size==0){
+    if(ptr!=NULL){
+      free(ptr);
+    }
+    return(NULL);
+  }
   if((ptr2=realloc(ptr,size))==NULL){
     fflush(NULL);
     fprintf(sp0,"Out of memory\n");



View it on GitLab: https://salsa.debian.org/debian-gis-team/snaphu/-/commit/0b57d0a6ff80e9ed71e4d038338660fef36ac81a

-- 
View it on GitLab: https://salsa.debian.org/debian-gis-team/snaphu/-/commit/0b57d0a6ff80e9ed71e4d038338660fef36ac81a
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-grass-devel/attachments/20240328/c131efb8/attachment-0001.htm>


More information about the Pkg-grass-devel mailing list