mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-10-15 06:16:00 +00:00
Fixed warning C6386: Buffer overrun while writing to 'palette_saved_alpha': the writable size is 'sizeof(Uint8)*((palette_saved_alpha_ncolors))' bytes, but '2' bytes might be written.
This commit is contained in:
@@ -1210,6 +1210,7 @@ SDL_Surface *SDL_ConvertSurface(SDL_Surface *surface, const SDL_PixelFormat *for
|
||||
if (set_opaque) {
|
||||
int i;
|
||||
palette_saved_alpha_ncolors = surface->format->palette->ncolors;
|
||||
if (palette_saved_alpha_ncolors > 0) {
|
||||
palette_saved_alpha = SDL_stack_alloc(Uint8, palette_saved_alpha_ncolors);
|
||||
for (i = 0; i < palette_saved_alpha_ncolors; i++) {
|
||||
palette_saved_alpha[i] = surface->format->palette->colors[i].a;
|
||||
@@ -1217,6 +1218,7 @@ SDL_Surface *SDL_ConvertSurface(SDL_Surface *surface, const SDL_PixelFormat *for
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Transform colorkey to alpha. for cases where source palette has duplicate values, and colorkey is one of them */
|
||||
if (copy_flags & SDL_COPY_COLORKEY) {
|
||||
|
Reference in New Issue
Block a user