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
This commit is contained in:
Tim Schumacher 2022-06-15 12:39:09 +02:00 committed by Sebastiano Barezzi
parent ec5d5b0a98
commit 5f0d7bbbe8
No known key found for this signature in database
GPG Key ID: 47760583F393BC44

View File

@ -8,12 +8,16 @@ static int stub_fail() {
return -1; return -1;
} }
static char *stub_fail_str() {
return "stub";
}
void *mg_facepp[] = { void *mg_facepp[] = {
&stub_fail, &stub_fail,
&stub_fail, &stub_fail,
&stub_fail, &stub_fail,
&stub_fail, &stub_fail_str,
&stub_fail, &stub_fail_str,
&stub_fail, &stub_fail,
&stub_fail, &stub_fail,
&stub_fail, &stub_fail,