mirror of
https://github.com/encounter/SDL.git
synced 2025-06-16 19:43:47 +00:00
Fixed loading 32-bit BMP files
This commit is contained in:
parent
ea7d5307ac
commit
0d7edcb703
@ -394,12 +394,6 @@ SDL_LoadBMP_RW(SDL_RWops * src, int freesrc)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (biBitCount >= 32) { /* we shift biClrUsed by this value later. */
|
|
||||||
SDL_SetError("Unsupported or incorrect biBitCount field");
|
|
||||||
was_error = SDL_TRUE;
|
|
||||||
goto done;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Create a compatible surface, note that the colors are RGB ordered */
|
/* Create a compatible surface, note that the colors are RGB ordered */
|
||||||
surface =
|
surface =
|
||||||
SDL_CreateRGBSurface(0, biWidth, biHeight, biBitCount, Rmask, Gmask,
|
SDL_CreateRGBSurface(0, biWidth, biHeight, biBitCount, Rmask, Gmask,
|
||||||
@ -418,6 +412,12 @@ SDL_LoadBMP_RW(SDL_RWops * src, int freesrc)
|
|||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (biBitCount >= 32) { /* we shift biClrUsed by this value later. */
|
||||||
|
SDL_SetError("Unsupported or incorrect biBitCount field");
|
||||||
|
was_error = SDL_TRUE;
|
||||||
|
goto done;
|
||||||
|
}
|
||||||
|
|
||||||
if (biClrUsed == 0) {
|
if (biClrUsed == 0) {
|
||||||
biClrUsed = 1 << biBitCount;
|
biClrUsed = 1 << biBitCount;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user