IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
May 14, 2004, 2:14:56 PM (22 years ago)
Author:
desonia
Message:

Fixed error found during testing of psImage.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/src/image/psImage.c

    r692 r693  
    77 *  @author Ross Harman, MHPCC
    88 *   
    9  *  @version $Revision: 1.6 $ $Name: not supported by cvs2svn $
    10  *  @date $Date: 2004-05-14 22:39:58 $
     9 *  @version $Revision: 1.7 $ $Name: not supported by cvs2svn $
     10 *  @date $Date: 2004-05-15 00:14:56 $
    1111 *
    1212 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    3434    area = numCols*numRows;
    3535
     36    if (area < 1) {
     37        psError(__func__, "Invalid value for number of rows or columns (numRows=%d, numCols=%d).",
     38                numRows, numCols);
     39        return NULL;
     40    }
     41
    3642    psImage *image = (psImage *)psAlloc(sizeof(psImage));
    3743
    38     if(area < 1) {
    39         image->data.v[0] = NULL;
    40     } else {
    41         image->data.v[0] = psAlloc(area*elementSize);
     44    image->data.v = psAlloc(sizeof(void*)*numRows);
    4245
    43         for(int i = 1; i < numRows; i++) {
    44             image->data.v[i] = (void*)((int8_t*)image->data.v[i-1]+rowSize);
    45         }
     46    image->data.v[0] = psAlloc(area*elementSize);
     47
     48    for(int i = 1; i < numRows; i++) {
     49        image->data.v[i] = (void*)((int8_t*)image->data.v[i-1]+rowSize);
    4650    }
    4751
Note: See TracChangeset for help on using the changeset viewer.