Projects
Mega:24.09
SDL
_service:tar_scm:CVE-2019-7635_1.patch
Sign Up
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File _service:tar_scm:CVE-2019-7635_1.patch of Package SDL
--- a/src/video/SDL_bmp.c 2012-01-19 14:30:06.000000000 +0800 +++ b/src/video/SDL_bmp.c 2019-04-22 11:29:33.990000000 +0800 @@ -296,6 +296,12 @@ SDL_Surface * SDL_LoadBMP_RW (SDL_RWops } *(bits+i) = (pixel>>shift); pixel <<= ExpandBMP; + if ( bits[i] >= biClrUsed ) { + SDL_SetError( + "A BMP image contains a pixel with a color out of the palette"); + was_error = SDL_TRUE; + goto done; + } } } break; @@ -306,6 +312,16 @@ SDL_Surface * SDL_LoadBMP_RW (SDL_RWops was_error = SDL_TRUE; goto done; } + if ( 8 == biBitCount && palette && biClrUsed < (1 << biBitCount ) ) { + for ( i=0; i<surface->w; ++i ) { + if ( bits[i] >= biClrUsed ) { + SDL_SetError( + "A BMP image contains a pixel with a color out of the palette"); + was_error = SDL_TRUE; + goto done; + } + } + } #if SDL_BYTEORDER == SDL_BIG_ENDIAN /* Byte-swap the pixels if needed. Note that the 24bpp case has already been taken care of above. */
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.
浙ICP备2022010568号-2