mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-05-03 23:00:14 +02:00
Check SDL_LockSurface() return value
This commit is contained in:
@@ -2045,7 +2045,9 @@ int SDL_ReadSurfacePixel(SDL_Surface *surface, int x, int y, Uint8 *r, Uint8 *g,
|
||||
bytes_per_pixel = SDL_BYTESPERPIXEL(surface->format);
|
||||
|
||||
if (SDL_MUSTLOCK(surface)) {
|
||||
SDL_LockSurface(surface);
|
||||
if (SDL_LockSurface(surface) < 0) {
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
p = (Uint8 *)surface->pixels + y * surface->pitch + x * bytes_per_pixel;
|
||||
|
||||
Reference in New Issue
Block a user