cufftExecR2C and C2R blues

I inherited an image processing program. It uses cufftExecR2C followed by cufftExecC2R as an image processing filter. For some reason it works perfectly fine with one set of images but then fouls up with another set. It does not go into error mode. It just fouls up the data and produces total garbage. The images are the same format, size, everything, except they have different values. If I do an end run around this part of the algorithm and remove cufftExecR2C/cufftExecC2R altogether the final image product comes out blank. Why does cufftExecR2C/cufftExecC2R fail internally due to different values in the matrices that I provide as input? How can I debug this or get around this?