2000.04.28 02:38 "VC++ Release build causes problems", by Peter Montgomery

2000.04.28 06:16 "VC++ Release build causes problems", by Peter Montgomery

Hi again,

I have just added some simple debugging to my program. As soon as I have returned from "TIFFReadScanline()", I check to see if I am working on scanline zero. IF so, I pop up a dialog box showing the RGBA values of pixel 0. Here's the code...

    ReturnVal = TIFFReadScanline(Tif, Buf, CurrSL, 0);
    if (CurrSL == 0){
     DebugPixel = Buf;
     sprintf(LogString, "TiffRead() DEBUG: Scanline 0 = %d, %d, %d, %d (RGBA).\n", DebugPixel[0], DebugPixel[1], DebugPixel[2], DebugPixel[3]);
     LogMess(LogString , ERROR_MESS);
    }

When I run this under the debug build, I get "Scanline0 = 0, 0, 0, 0 (RGBA)." When I run it under the release build I get "Scanline0 = 0, 255, 255, 255 (RGBA)." Now then, as you can see, I haven't done anything other than make a library call, and the buffer that's returned has bogus data. This is why I suspect that the libray is incorrectly zeroing out a buffer, or trying to optimize something that's backfiring.

The problem only occurs when a channel has a pixel that's set to zero. Instead of getting zero, the libray often returns 255 instead, causing the pixels to become bizarre colors. If there's anyone who knows the inner workings of the library better than me, I would love the help. I'm trying to compile the relase build without debug info so I can step through it, but I'm not having a lot of luck.

Thanks,
PeterM