Original Post
If you:
//nImageComps = number of image components, ie 3 (R,G and B) pPreImage = (unsigned char *)malloc(nPreWidth * nPreHeight * nImageComps); //read in image to pPreImage //calculate new size for image pPostImage = (unsigned char *)malloc(nPostWidth * nPostHeight * nImageComps); gluScaleImage(GL_BGRA_EXT, nPreWidth, nPreHeight, GL_UNSIGNED_BYTE, pPreImage, nPostWidth, nPostHeight, GL_UNSIGNED_BYTE, pPostImage);Why does gluScaleImage generate an exception? Can gluScaleImage() write to the malloc''ed memory at pPostImage? Cheers.