minui: Fix a wrong arg in calling GRSurface::Create().
This is a bug introduced while refactoring init_display_surface(), in
[1]. As a result, user of res_create_multi_display_surface(), which is
effectively `charger` right now, crashes due to buffer overrun.
This CL fixes the wrong arg and adds a sanity test for
res_create_multi_display_surface(). The testdata (battery_scale.png) is
copied from system/core/healthd/images/battery_scale.png.
[1] commit 44820ac1e3.
Bug: 119122296
Test: Run recovery_unit_test on marlin.
Test: Build and boot into charger mode on blueline. Verify that
`charger` no longer crashes.
Change-Id: Ib6d083e1512a9c3c6eb63874d26d22658921d693
This commit is contained in:
+1
-1
@@ -261,7 +261,7 @@ int res_create_multi_display_surface(const char* name, int* frames, int* fps,
|
||||
for (int i = 0; i < *frames; ++i) {
|
||||
auto height_per_frame = height / *frames;
|
||||
auto created_surface =
|
||||
GRSurface::Create(width, height_per_frame, width * 4, 4, width * height_per_frame);
|
||||
GRSurface::Create(width, height_per_frame, width * 4, 4, width * height_per_frame * 4);
|
||||
if (!created_surface) {
|
||||
result = -8;
|
||||
goto exit;
|
||||
|
||||
Reference in New Issue
Block a user