Original Post
I am loading an 8bit 256 color bmp. Now it works most of the time, but it crashes with some bmp. specifically bmp''s that I make in photoshop.
The following are some snippets of code that may have something to do with my problem. NOte I actually crash on the memcpy
bytes_per_line = bitmap->bitmapinfoheader.biWidth*(bitmap->bitmapinfoheader.biBitCount/8)
if (!(buffer = (UCHAR *)malloc(bytes_per_line*height)))
return(0);
memcpy(buffer,image,bytes_per_line*height);
