DDS without equal dimenions with mip maps crashing

Issue #44 resolved
Anonymous created an issue

Hey There,

glimg is crashing with a vector subscript out of range whenever you try to load a dds texture (both compressed and non compressed) that has mip maps and is not a square texture (for e.g 2048x1024). If you remove the mip map's with say amd's compressonator it works perfectly, only when the texture has mip maps does it crash.

FIle: ImageCreator.cpp line 233



Comments (5)

  1. timmy

    Sorry forgot to login above ^^^

    Solved the problem, when using non square textures as mentioned above the last mip map level ends up with the dimensions of 0x1. So i added a check in the function

    Dimensions ModifySizeForMipmap(Dimensions origDim, int mipmapLevel) 
    if(origDim.width < 1)
                origDim.width =1;

    This seemed to fix the problem.



    *edit I guess the height should be checked also.

  2. Log in to comment