summaryrefslogtreecommitdiffstats
path: root/libs/hwui
diff options
context:
space:
mode:
authorRomain Guy <romainguy@google.com>2010-11-09 16:37:03 -0800
committerRomain Guy <romainguy@google.com>2010-11-09 16:37:28 -0800
commitf70a7e34953438dd70573dbb6fd3dd34a1bce831 (patch)
tree4e479d32f7d091d13ce5ba9c8a8f0ab9acd7f58e /libs/hwui
parent9e10841c27d973b930e1b49a099c69d866659505 (diff)
downloadframeworks_base-f70a7e34953438dd70573dbb6fd3dd34a1bce831.zip
frameworks_base-f70a7e34953438dd70573dbb6fd3dd34a1bce831.tar.gz
frameworks_base-f70a7e34953438dd70573dbb6fd3dd34a1bce831.tar.bz2
Fix possible crash when texture is NULL in the drop shadow cache.
Change-Id: I2142c55dbcfebcdf013a7f4ae04b266a60f5ce8a
Diffstat (limited to 'libs/hwui')
-rw-r--r--libs/hwui/TextDropShadowCache.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/libs/hwui/TextDropShadowCache.cpp b/libs/hwui/TextDropShadowCache.cpp
index 9d54277..2f7c7be 100644
--- a/libs/hwui/TextDropShadowCache.cpp
+++ b/libs/hwui/TextDropShadowCache.cpp
@@ -74,10 +74,10 @@ void TextDropShadowCache::setMaxSize(uint32_t maxSize) {
///////////////////////////////////////////////////////////////////////////////
void TextDropShadowCache::operator()(ShadowText& text, ShadowTexture*& texture) {
- const uint32_t size = texture->width * texture->height;
- mSize -= size;
-
if (texture) {
+ const uint32_t size = texture->width * texture->height;
+ mSize -= size;
+
glDeleteTextures(1, &texture->id);
delete texture;
}