IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
May 29, 2015, 5:24:53 PM (11 years ago)
Author:
eugene
Message:

table compression is internally consistent (tables can be generated and compressed)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ohana.20150429/src/libfits/table/F_compress_T.c

    r38329 r38334  
    5656
    5757  TableField *fields = NULL;
    58   ALLOCATE (fields, TableField, Nfields);
     58  ALLOCATE_ZERO (fields, TableField, Nfields);
    5959  for (i = 0; i < Nfields; i++) {
    6060    snprintf (keyword, 80, "TTYPE%d", i+1);
     
    129129
    130130    fields[i].offset = offset;
    131     offset += fields[i].offset;
     131    offset += fields[i].rowsize;
    132132  }
    133133
    134134  // allocate the intermediate storage buffers
     135  int Nzdata_alloc = max_width*ztilelen + 100;
    135136  ALLOCATE (raw,   char, max_width*ztilelen);
    136   ALLOCATE (zdata, char, max_width*ztilelen);
     137  ALLOCATE (zdata, char, Nzdata_alloc);
    137138
    138139  // compress the data : copy into a tile, compress the tile, then add to the output table
     
    153154     
    154155      int Nraw = Nrows*fields[j].Nvalues; // number of pixels
    155       int Nzdata = max_width*ztilelen; // available space, replaced with actual output size on compression
     156      int Nzdata = Nzdata_alloc; // available space, replaced with actual output size on compression
    156157      if (!gfits_compress_data (zdata, &Nzdata, fields[j].zctype, NULL, NULL, 0, raw, Nraw, fields[j].pixsize)) ESCAPE(A);
    157158     
Note: See TracChangeset for help on using the changeset viewer.