The colormap was being written within the DIB header. It must follow both the mask and color space info.