bmp: Fix warning X may be used uninitialized in this function