Projects
openEuler:Mainline
SDL2
_service:tar_scm:backport-CVE-2021-33657.patch
Sign Up
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File _service:tar_scm:backport-CVE-2021-33657.patch of Package SDL2
From 8c91cf7dba5193f5ce12d06db1336515851c9ee9 Mon Sep 17 00:00:00 2001 From: Sam Lantinga <slouken@libsdl.org> Date: Tue, 30 Nov 2021 12:36:46 -0800 Subject: [PATCH] Always create a full 256-entry map in case color values are out of range Fixes https://github.com/libsdl-org/SDL/issues/5042 --- src/video/SDL_pixels.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/video/SDL_pixels.c b/src/video/SDL_pixels.c index ac04533c5d5..9bb02f771d0 100644 --- a/src/video/SDL_pixels.c +++ b/src/video/SDL_pixels.c @@ -947,7 +947,7 @@ Map1to1(SDL_Palette * src, SDL_Palette * dst, int *identical) } *identical = 0; } - map = (Uint8 *) SDL_malloc(src->ncolors); + map = (Uint8 *) SDL_calloc(256, sizeof(Uint8)); if (map == NULL) { SDL_OutOfMemory(); return (NULL); @@ -971,7 +971,7 @@ Map1toN(SDL_PixelFormat * src, Uint8 Rmod, Uint8 Gmod, Uint8 Bmod, Uint8 Amod, SDL_Palette *pal = src->palette; bpp = ((dst->BytesPerPixel == 3) ? 4 : dst->BytesPerPixel); - map = (Uint8 *) SDL_malloc(pal->ncolors * bpp); + map = (Uint8 *) SDL_calloc(256, bpp); if (map == NULL) { SDL_OutOfMemory(); return (NULL);
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