IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Feb 8, 2007, 1:56:02 PM (19 years ago)
Author:
Paul Price
Message:

Fixing memory corruption issue due to confusing columns and rows in the final copy.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/src/fft/psImageFFT.c

    r11703 r11714  
    66/// @author Robert DeSonia, MHPCC
    77///
    8 /// @version $Revision: 1.21 $ $Name: not supported by cvs2svn $
    9 /// @date $Date: 2007-02-08 04:17:58 $
     8/// @version $Revision: 1.22 $ $Name: not supported by cvs2svn $
     9/// @date $Date: 2007-02-08 23:56:02 $
    1010///
    1111/// Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    129129    psF32 *target = psAlloc(2 * numCols * numRows * PSELEMTYPE_SIZEOF(PS_TYPE_F32)); // Target for FFTW
    130130    fftwf_complex *in = fftwf_malloc(numCols * numRows * sizeof(fftwf_complex)); // Input data
     131
    131132    for (int y = 0, index = 0; y < numRows; y++) {
    132133        for (int x = 0; x < numCols; index++, x++) {
     
    156157    // while the output doesn't.
    157158    for (int y = 0, index = 0; y < numRows; y++, index += origCols) {
    158         memcpy(&(*out)->data.F32[y][0], &target[index], numRows * PSELEMTYPE_SIZEOF(PS_TYPE_F32));
     159        memcpy(&(*out)->data.F32[y][0], &target[index], numCols * PSELEMTYPE_SIZEOF(PS_TYPE_F32));
    159160    }
    160161    psFree(target);
Note: See TracChangeset for help on using the changeset viewer.