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
This commit is contained in:
Alistair Strachan 2017-04-28 15:05:33 -07:00 committed by Tao Bao
parent 0481faef77
commit 4697d8b11b

View file

@ -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 = {};