diff options
Diffstat (limited to 'libs/androidfw/Asset.cpp')
-rw-r--r-- | libs/androidfw/Asset.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/libs/androidfw/Asset.cpp b/libs/androidfw/Asset.cpp index 4fbe4a3efbdd..43a70c176a83 100644 --- a/libs/androidfw/Asset.cpp +++ b/libs/androidfw/Asset.cpp @@ -594,7 +594,12 @@ void _FileAsset::close(void) */ const void* _FileAsset::getBuffer(bool aligned) { - return getIncFsBuffer(aligned).unsafe_ptr(); + auto buffer = getIncFsBuffer(aligned); + if (mBuf != NULL) + return mBuf; + if (!buffer.convert<uint8_t>().verify(mLength)) + return NULL; + return buffer.unsafe_ptr(); } incfs::map_ptr<void> _FileAsset::getIncFsBuffer(bool aligned) |