mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-10-26 12:27:44 +00:00
Ignore invalid width/height in setOrientationBis()
This commit is contained in:
@@ -1120,6 +1120,11 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh
|
|||||||
int orientation_landscape = -1;
|
int orientation_landscape = -1;
|
||||||
int orientation_portrait = -1;
|
int orientation_portrait = -1;
|
||||||
|
|
||||||
|
if (w <= 1 || h <= 1) {
|
||||||
|
// Invalid width/height, ignore this request
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
/* If set, hint "explicitly controls which UI orientations are allowed". */
|
/* If set, hint "explicitly controls which UI orientations are allowed". */
|
||||||
if (hint.contains("LandscapeRight") && hint.contains("LandscapeLeft")) {
|
if (hint.contains("LandscapeRight") && hint.contains("LandscapeLeft")) {
|
||||||
orientation_landscape = ActivityInfo.SCREEN_ORIENTATION_USER_LANDSCAPE;
|
orientation_landscape = ActivityInfo.SCREEN_ORIENTATION_USER_LANDSCAPE;
|
||||||
|
|||||||
Reference in New Issue
Block a user