mirror of https://github.com/encounter/SDL.git
Fixed rare null pointer dereference
This commit is contained in:
parent
ef34704875
commit
da89b81c3c
|
@ -1512,6 +1512,10 @@ class SDLSurface extends SurfaceView implements SurfaceHolder.Callback,
|
||||||
int format, int width, int height) {
|
int format, int width, int height) {
|
||||||
Log.v("SDL", "surfaceChanged()");
|
Log.v("SDL", "surfaceChanged()");
|
||||||
|
|
||||||
|
if (SDLActivity.mSingleton == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
int sdlFormat = 0x15151002; // SDL_PIXELFORMAT_RGB565 by default
|
int sdlFormat = 0x15151002; // SDL_PIXELFORMAT_RGB565 by default
|
||||||
switch (format) {
|
switch (format) {
|
||||||
case PixelFormat.A_8:
|
case PixelFormat.A_8:
|
||||||
|
@ -1577,7 +1581,6 @@ class SDLSurface extends SurfaceView implements SurfaceHolder.Callback,
|
||||||
Log.v("SDL", "Device size: " + nDeviceWidth + "x" + nDeviceHeight);
|
Log.v("SDL", "Device size: " + nDeviceWidth + "x" + nDeviceHeight);
|
||||||
SDLActivity.onNativeResize(width, height, nDeviceWidth, nDeviceHeight, sdlFormat, mDisplay.getRefreshRate());
|
SDLActivity.onNativeResize(width, height, nDeviceWidth, nDeviceHeight, sdlFormat, mDisplay.getRefreshRate());
|
||||||
|
|
||||||
|
|
||||||
boolean skip = false;
|
boolean skip = false;
|
||||||
int requestedOrientation = SDLActivity.mSingleton.getRequestedOrientation();
|
int requestedOrientation = SDLActivity.mSingleton.getRequestedOrientation();
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue