Fix a hang in SF caused by invalid transform matrix from the WM

WindowManager could create by transforms because of divide by zero.

Bug: 5422468
Change-Id: I782f87ebb78b5ff23750e22837f36ca6cfed1f2f
This commit is contained in:
Mathias Agopian
2011-10-18 20:19:59 -07:00
parent 0d0fba4587
commit 526f0a0e15

View File

@@ -1120,7 +1120,11 @@ final class WindowState implements WindowManagerPolicy.WindowState {
// window's center).
final float w = frame.width();
final float h = frame.height();
tmpMatrix.setScale(1 + 2/w, 1 + 2/h, w/2, h/2);
if (w>=1 && h>=1) {
tmpMatrix.setScale(1 + 2/w, 1 + 2/h, w/2, h/2);
} else {
tmpMatrix.reset();
}
} else {
tmpMatrix.reset();
}