Ryan C. Gordon fed8465085
loadbmp: Attempt to handle small palettes better.
Only adjust the biClrUsed field if it is set to zero in the bitmap, and make
some effort to make sure we don't overflow a buffer in any case.

This was triggering an issue with the sailboat bmp used for testpalette.c in
SDL 1.2, which is an 8-bit paletted image with 66 palette entries instead of
256. See discussion at https://github.com/libsdl-org/sdl12-compat/issues/63

This change might be a problem, but there's no indication this code, which
originally landed in SDL_image 17 years ago with a large rewrite, is actually
fixing a specific issue. I'm also not sure we should actually make an effort
to accept a bmp that has a biClrUsed field that is both non-zero and _also_
incorrect.
2021-05-27 10:49:25 -04:00
2021-04-01 16:36:06 -04:00
2021-04-25 01:28:03 +03:00
2021-05-15 00:22:50 +03:00
2021-02-22 15:44:32 +03:00
2021-05-15 00:22:50 +03:00
2021-04-05 15:38:32 -04:00
2021-05-15 00:22:50 +03:00
2021-04-24 14:13:09 -07:00
2021-03-13 18:36:01 -08:00
2018-08-21 13:29:21 -07:00
2018-08-21 13:29:21 -07:00
2018-08-21 13:29:21 -07:00
2020-12-22 17:00:28 +03:00
2020-12-09 10:39:36 -08:00

Simple DirectMedia Layer (SDL) Version 2.0

https://www.libsdl.org/

Simple DirectMedia Layer is a cross-platform development library designed to provide low level access to audio, keyboard, mouse, joystick, and graphics hardware via OpenGL and Direct3D. It is used by video playback software, emulators, and popular games including Valve's award winning catalog and many Humble Bundle games.

More extensive documentation is available in the docs directory, starting with README.md

Enjoy!

Sam Lantinga (slouken@libsdl.org)

Description
Simple Directmedia Layer
Readme 162 MiB
Languages
C 86.1%
C++ 5.9%
Objective-C 3.6%
CMake 1.6%
Perl 0.8%
Other 1.7%