hardware_xiaomi/megvii/megvii.c
Tim Schumacher 5f0d7bbbe8
megvii: Return a char pointer for some stubs instead
`mg_facepp[3]` and `mg_facepp[4]` seem to return version strings, which
occasionally get logged if the return value is non-zero.

Return a dummy string for those functions to avoid crashing in strlen.

Change-Id: Icc5d2ab2f72c480f03e652e3849aceaf4cfb498b
2022-06-21 18:33:32 +02:00

44 lines
654 B
C

/*
* Copyright (C) 2022 The LineageOS Project
*
* SPDX-License-Identifier: Apache-2.0
*/
static int stub_fail() {
return -1;
}
static char *stub_fail_str() {
return "stub";
}
void *mg_facepp[] = {
&stub_fail,
&stub_fail,
&stub_fail,
&stub_fail_str,
&stub_fail_str,
&stub_fail,
&stub_fail,
&stub_fail,
&stub_fail,
&stub_fail,
&stub_fail,
&stub_fail,
&stub_fail,
&stub_fail,
&stub_fail,
&stub_fail,
&stub_fail,
&stub_fail,
&stub_fail,
&stub_fail,
&stub_fail,
&stub_fail,
&stub_fail,
&stub_fail,
&stub_fail,
&stub_fail,
&stub_fail,
};