Jump to content
  • Advertisement
Sign in to follow this  
Boder

VS2005 TIFF Library Crash

This topic is 4434 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I am using VS2005 Express to build some example code that uses OpenGL, GLUT, and the TIFF Library. I am using the precompiled TIFF developer package for Windows. The code is not mine, but it keeps crashing (...has encountered a problem and needs to close). Now to hunt down the problem. I am wondering if the problem could be they built it with a different compiler. Here are the dependencies.
    TIFF* tif = NULL;
    int idx;
    for( idx = 0; idx < ogld::OGLDif::instance()->getDataPathSize(); idx++)
    {
        std::string fullPath = ogld::OGLDif::instance()->getDataPath( idx ) + fileName;
        tif = TIFFOpen( fullPath.c_str(), "r" );
        if (tif)
            break;
    }
    if (!tif)
        return false;

    uint32 w, h;
    size_t npixels;
    uint16 photometric;
    uint16 config;
    uint16 samples;

    TIFFGetField( tif, TIFFTAG_PHOTOMETRIC, &photometric ); // CRASH!!!!!
    assert( photometric == PHOTOMETRIC_RGB );
    TIFFGetField( tif, TIFFTAG_PLANARCONFIG, &config );
    assert( config == PLANARCONFIG_CONTIG );

Share this post


Link to post
Share on other sites
Advertisement
I've never used this library but according to what I've read on other websites, your usage seems correct.

Did you try running it in a debugger? At least to know what's the "crash"?

Are you sure its not your assert function that's crashing? I've seen assert implementations that did ugly things (such as *(int*)0 = 0; to "stop" the execution)

Cheers

Share this post


Link to post
Share on other sites
Well this is annoying.

Express decides to tell me (for the Debug version):

---------------------------
This application has failed to start because MSVCP80D.dll was not found. Re-installing the application may fix this problem.
---------------------------

EDIT: The DLL error went away so I was able to use the debugger. I found it definitely fails on that function call. Access violation reading location 0x00000245.

[Edited by - Boder on May 1, 2006 1:25:49 AM]

Share this post


Link to post
Share on other sites
Somehow the TIFF structure isn't allocated properly, I'm wondering if MSVCRT could be not allowing allocation.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!