g2clib/g2clib-simunpack.patch
yangshaoxing 6a57eb63bb Log:g2clib init
Signed-off-by: yangshaoxing <yangshaoxing@uniontech.com>
2021-02-03 16:58:20 +08:00

13 lines
582 B
Diff

diff -up g2clib-1.6.0.p12/simunpack.c g2clib-1.6.0.p123/simunpack.c
--- g2clib-1.6.0.p12/simunpack.c 2017-08-13 10:24:02.266764550 +0200
+++ g2clib-1.6.0.p123/simunpack.c 2017-08-13 10:50:49.881774231 +0200
@@ -49,7 +49,7 @@ g2int simunpack(unsigned char *cpack,g2i
nbits = idrstmpl[3];
itype = idrstmpl[4];
- ifld=(g2int *)calloc(ndpts,sizeof(g2int));
+ ifld=(g2int *)calloc((ndpts ? ndpts : 1),sizeof(g2int));
if ( ifld == 0 ) {
fprintf(stderr,"Could not allocate space in simunpack.\n Data field NOT upacked.\n");
return(1);