diff options
author | Alistair Strachan | 2017-04-28 17:05:33 -0500 |
---|---|---|
committer | Tao Bao | 2017-04-28 18:13:02 -0500 |
commit | 4697d8b11b259a8dbed5998381265f7010eb6318 (patch) | |
tree | 271bd30c7db105925f0a8689bde1e8703933ae1b /minui | |
parent | 0481faef77bf87e1c44b787c4aaf92e57cccf988 (diff) | |
download | platform-bootable-recovery-4697d8b11b259a8dbed5998381265f7010eb6318.tar.gz platform-bootable-recovery-4697d8b11b259a8dbed5998381265f7010eb6318.tar.xz platform-bootable-recovery-4697d8b11b259a8dbed5998381265f7010eb6318.zip |
minui: Fix breakage in graphics_adf.
When graphics_adf was refactored in 557fa1f, a class member was introduced
that was not initialized to zero. This meant that the first time Flip()
was called, current_surface would have a junk value and cause a bad
pointer rereference, crashing recovery.
Make sure current_surface is initialized to 0 for the first Flip().
Test: Ran recovery on a device using the ADF backend.
Change-Id: I9b8fac0a4d48cac990e5e9808a071c232de1ebfb
Diffstat (limited to 'minui')
-rw-r--r-- | minui/graphics_adf.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/minui/graphics_adf.cpp b/minui/graphics_adf.cpp index 1b15a04f..a59df00c 100644 --- a/minui/graphics_adf.cpp +++ b/minui/graphics_adf.cpp | |||
@@ -28,7 +28,8 @@ | |||
28 | 28 | ||
29 | #include "minui/minui.h" | 29 | #include "minui/minui.h" |
30 | 30 | ||
31 | MinuiBackendAdf::MinuiBackendAdf() : intf_fd(-1), dev(), n_surfaces(0), surfaces() {} | 31 | MinuiBackendAdf::MinuiBackendAdf() |
32 | : intf_fd(-1), dev(), current_surface(0), n_surfaces(0), surfaces() {} | ||
32 | 33 | ||
33 | int MinuiBackendAdf::SurfaceInit(const drm_mode_modeinfo* mode, GRSurfaceAdf* surf) { | 34 | int MinuiBackendAdf::SurfaceInit(const drm_mode_modeinfo* mode, GRSurfaceAdf* surf) { |
34 | *surf = {}; | 35 | *surf = {}; |