Index: src/lazy/SkLruImageCache.cpp |
diff --git a/src/lazy/SkLruImageCache.cpp b/src/lazy/SkLruImageCache.cpp |
index 6beb8a479bf59497b9ead4802aca899252ea58d6..54f26fb5dcbf8263e143b12ce9efe846b5f1da38 100644 |
--- a/src/lazy/SkLruImageCache.cpp |
+++ b/src/lazy/SkLruImageCache.cpp |
@@ -133,7 +133,6 @@ void SkLruImageCache::releaseCache(intptr_t ID) { |
} |
void SkLruImageCache::throwAwayCache(intptr_t ID) { |
- SkASSERT(ID != SkImageCache::UNINITIALIZED_ID); |
SkAutoMutexAcquire ac(&fMutex); |
CachedPixels* pixels = this->findByID(ID); |
if (pixels != NULL) { |
@@ -156,6 +155,9 @@ void SkLruImageCache::removePixels(CachedPixels* pixels) { |
CachedPixels* SkLruImageCache::findByID(intptr_t ID) const { |
// Mutex is already locked. |
+ if (SkImageCache::UNINITIALIZED_ID == ID) { |
+ return NULL; |
+ } |
Iter iter; |
// Start from the head, most recently used. |
CachedPixels* pixels = iter.init(fLRU, Iter::kHead_IterStart); |