diff options
author | Quallenauge <Hamsi2k@freenet.de> | 2019-09-22 21:28:13 +0200 |
---|---|---|
committer | Michael Bestas <mkbestas@lineageos.org> | 2020-04-30 00:48:53 +0300 |
commit | 92c6b47542e11627c635e6ddeb3dab6dd4e36322 (patch) | |
tree | 44efe75730385c0683e7fed9905bdc6d7691723a | |
parent | ee57f80147dfeb0a2c2a9724294ff01d20b740d3 (diff) |
sdm660-common: libshims: Respect non-static member function calls.
As stated in
https://www.learncpp.com/cpp-tutorial/8-8-the-hidden-this-pointer/
member functions contains a hidden parameter (a pointer of the current
reference of teh object, aka "this"). This way the code knows in which
context the member function is called. We have to resprect that behavior
into our shims which otherwise crashes or lead to memory corruption.
Change-Id: I68197ebafde8773fd73d7dafb9b2f1bae92ee170
-rw-r--r-- | libshims/camera_sdm660_shim.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/libshims/camera_sdm660_shim.cpp b/libshims/camera_sdm660_shim.cpp index c18e5a4..2b6c4f9 100644 --- a/libshims/camera_sdm660_shim.cpp +++ b/libshims/camera_sdm660_shim.cpp @@ -1,9 +1,11 @@ #include <stdint.h> namespace android { - extern "C" void _ZN7android13GraphicBuffer4lockEjPPvPiS3_(uint32_t inUsage, void** vaddr, int32_t* outBytesPerPixel, int32_t* outBytesPerStride); + extern "C" void _ZN7android13GraphicBuffer4lockEjPPvPiS3_(void* thisptr, uint32_t inUsage, + void** vaddr, int32_t* outBytesPerPixel, int32_t* outBytesPerStride); - extern "C" void _ZN7android13GraphicBuffer4lockEjPPv(uint32_t inUsage, void** vaddr) { - _ZN7android13GraphicBuffer4lockEjPPvPiS3_(inUsage, vaddr, nullptr, nullptr); + extern "C" void _ZN7android13GraphicBuffer4lockEjPPv(void* thisptr, uint32_t inUsage, + void** vaddr) { + _ZN7android13GraphicBuffer4lockEjPPvPiS3_(thisptr, inUsage, vaddr, nullptr, nullptr); } } |