diff options
Diffstat (limited to 'libs/hwui/font/CacheTexture.cpp')
-rw-r--r-- | libs/hwui/font/CacheTexture.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/libs/hwui/font/CacheTexture.cpp b/libs/hwui/font/CacheTexture.cpp index e2844ad0649a..73beba9297c4 100644 --- a/libs/hwui/font/CacheTexture.cpp +++ b/libs/hwui/font/CacheTexture.cpp @@ -91,6 +91,9 @@ CacheBlock* CacheBlock::removeBlock(CacheBlock* head, CacheBlock* blockToRemove) CacheBlock* prevBlock = blockToRemove->mPrev; if (prevBlock) { + // If this doesn't hold, we have a use-after-free below. + LOG_ALWAYS_FATAL_IF(head == blockToRemove, + "removeBlock: head should not have a previous block"); prevBlock->mNext = nextBlock; } else { newHead = nextBlock; |