mirror of
https://github.com/encounter/SDL.git
synced 2025-12-21 10:49:12 +00:00
static analysis: Fixed several complaints from codechecker.
There are still some pending Objective-C specific issues. Reference issue #4600.
This commit is contained in:
@@ -394,6 +394,12 @@ SDL_LoadBMP_RW(SDL_RWops * src, int freesrc)
|
||||
break;
|
||||
}
|
||||
|
||||
if (biBitCount >= 32) { /* we shift biClrUsed by this value later. */
|
||||
SDL_SetError("Unsupported or incorrect biBitCount field");
|
||||
was_error = SDL_TRUE;
|
||||
goto done;
|
||||
}
|
||||
|
||||
/* Create a compatible surface, note that the colors are RGB ordered */
|
||||
surface =
|
||||
SDL_CreateRGBSurface(0, biWidth, biHeight, biBitCount, Rmask, Gmask,
|
||||
|
||||
@@ -530,7 +530,7 @@ SDL_EGL_LoadLibrary(_THIS, const char *egl_path, NativeDisplayType native_displa
|
||||
}
|
||||
#endif
|
||||
/* Try the implementation-specific eglGetDisplay even if eglGetPlatformDisplay fails */
|
||||
if (_this->egl_data->egl_display == EGL_NO_DISPLAY) {
|
||||
if ((_this->egl_data->egl_display == EGL_NO_DISPLAY) && (_this->egl_data->eglGetDisplay != NULL)) {
|
||||
_this->egl_data->egl_display = _this->egl_data->eglGetDisplay(native_display);
|
||||
}
|
||||
if (_this->egl_data->egl_display == EGL_NO_DISPLAY) {
|
||||
|
||||
@@ -261,6 +261,7 @@ SDL_CreateWindowTexture(SDL_VideoDevice *_this, SDL_Window * window, Uint32 * fo
|
||||
SDL_TEXTUREACCESS_STREAMING,
|
||||
window->w, window->h);
|
||||
if (!data->texture) {
|
||||
/* codechecker_false_positive [Malloc] Static analyzer doesn't realize allocated `data` is saved to SDL_WINDOWTEXTUREDATA and not leaked here. */
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -1184,6 +1185,7 @@ SDL_GetWindowDisplayMode(SDL_Window * window, SDL_DisplayMode * mode)
|
||||
} else if (!SDL_GetClosestDisplayModeForDisplay(SDL_GetDisplayForWindow(window),
|
||||
&fullscreen_mode,
|
||||
&fullscreen_mode)) {
|
||||
SDL_zerop(mode);
|
||||
return SDL_SetError("Couldn't find display mode match");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user