summaryrefslogtreecommitdiff
path: root/libs/androidfw/Asset.cpp
diff options
context:
space:
mode:
authorBrian Orr <brianorr@google.com>2021-06-15 12:47:53 -0700
committerDaniel Norman <danielnorman@google.com>2021-06-17 13:37:54 -0700
commit71c831703ae59baf47e0afe611fecd714c481cdf (patch)
tree06731a987032723085b9e1a65951cf96abbc19cf /libs/androidfw/Asset.cpp
parent065c9e9a6e9d61d4383a91721eb56a3de253bdbe (diff)
parent81833820d54b9a6b27894f9f8dfd72222d416992 (diff)
Merge SP1A.210604.001
Change-Id: I5200ee05285ae422d5e9c1c00f45709a5d6188be
Diffstat (limited to 'libs/androidfw/Asset.cpp')
-rw-r--r--libs/androidfw/Asset.cpp7
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)