diff options
author | Ben Murdoch <benm@google.com> | 2010-05-13 11:51:29 +0100 |
---|---|---|
committer | Ben Murdoch <benm@google.com> | 2010-05-13 11:51:29 +0100 |
commit | e99258ca6edd7c8df76ccf8842abfd7bff7c49a1 (patch) | |
tree | 301eccc840297cbb3bd4fb40d340c50f6f3ca061 /WebCore/platform/android | |
parent | cae38efe66aa87d4dbcc096e0d59574e6f7122d7 (diff) | |
download | external_webkit-e99258ca6edd7c8df76ccf8842abfd7bff7c49a1.zip external_webkit-e99258ca6edd7c8df76ccf8842abfd7bff7c49a1.tar.gz external_webkit-e99258ca6edd7c8df76ccf8842abfd7bff7c49a1.tar.bz2 |
Fix crash in fast/frames/iframe-access-screen-of-deleted.html
This is a new layout test and triggers a crash inside screenRect() by
accessing the null page pointer. Other platform implementations perform
a null check on page in this function, so we now do the same to prevent
the crash.
Change-Id: I2403d7adc157daae69f6fb53bbbf212d9d04341c
Diffstat (limited to 'WebCore/platform/android')
-rw-r--r-- | WebCore/platform/android/ScreenAndroid.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/WebCore/platform/android/ScreenAndroid.cpp b/WebCore/platform/android/ScreenAndroid.cpp index 21df08a..70cf794 100644 --- a/WebCore/platform/android/ScreenAndroid.cpp +++ b/WebCore/platform/android/ScreenAndroid.cpp @@ -68,6 +68,9 @@ bool screenIsMonochrome(Widget* page) // the accuracy of these number are not too important. FloatRect screenRect(Widget* page) { + if (!page) + return FloatRect(); + IntRect rect = page->root()->platformWidget()->getBounds(); return FloatRect(0.0, 0.0, rect.width(), rect.height()); } @@ -76,6 +79,9 @@ FloatRect screenRect(Widget* page) // to position and resize windows (usually to full screen). FloatRect screenAvailableRect(Widget* page) { + if (!page) + return FloatRect(); + IntRect rect = page->root()->platformWidget()->getBounds(); return FloatRect(0.0, 0.0, rect.width(), rect.height()); } |