From 4697d8b11b259a8dbed5998381265f7010eb6318 Mon Sep 17 00:00:00 2001 From: Alistair Strachan Date: Fri, 28 Apr 2017 15:05:33 -0700 Subject: 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 --- minui/graphics_adf.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/minui/graphics_adf.cpp b/minui/graphics_adf.cpp index 1b15a04fb..a59df00c6 100644 --- a/minui/graphics_adf.cpp +++ b/minui/graphics_adf.cpp @@ -28,7 +28,8 @@ #include "minui/minui.h" -MinuiBackendAdf::MinuiBackendAdf() : intf_fd(-1), dev(), n_surfaces(0), surfaces() {} +MinuiBackendAdf::MinuiBackendAdf() + : intf_fd(-1), dev(), current_surface(0), n_surfaces(0), surfaces() {} int MinuiBackendAdf::SurfaceInit(const drm_mode_modeinfo* mode, GRSurfaceAdf* surf) { *surf = {}; -- cgit v1.2.3