Check whether on_screen is null before performing CFBooleanGetValue()
A crash may randomly happen in IsWindowMinimized(), the potential reason is that |on_screen| is not retrieved from |window| with kCGWindowIsOnScreen property. So add a == NULL check before executing CFBooleanGetValue(). Bug: chromium:758554 Change-Id: I25ad1ddbb21ec049ef237e55a8d25156bcd982c7 Reviewed-on: https://chromium-review.googlesource.com/634043 Reviewed-by: Jamie Walch <jamiewalch@chromium.org> Commit-Queue: Zijie He <zijiehe@chromium.org> Cr-Commit-Position: refs/heads/master@{#19527}
This commit is contained in:
parent
f3b151bea6
commit
c1f691dff2
@ -141,7 +141,7 @@ bool IsWindowFullScreen(
|
||||
bool IsWindowMinimized(CFDictionaryRef window) {
|
||||
CFBooleanRef on_screen = reinterpret_cast<CFBooleanRef>(
|
||||
CFDictionaryGetValue(window, kCGWindowIsOnscreen));
|
||||
return !CFBooleanGetValue(on_screen);
|
||||
return on_screen != NULL && !CFBooleanGetValue(on_screen);
|
||||
}
|
||||
|
||||
// Returns true if the window is minimized.
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user