Index: src/lazy/SkLazyPixelRef.cpp |
diff --git a/src/lazy/SkLazyPixelRef.cpp b/src/lazy/SkLazyPixelRef.cpp |
index a20b3c028d0850cd80075b01225422bf30007c74..9ae22f22075d5dab30f55e931e761a16759cb6e2 100644 |
--- a/src/lazy/SkLazyPixelRef.cpp |
+++ b/src/lazy/SkLazyPixelRef.cpp |
@@ -88,6 +88,8 @@ void* SkLazyPixelRef::onLockPixels(SkColorTable**) { |
// FIXME: As an optimization, only do this part once. |
fErrorInDecoding = !fDecodeProc(fData->data(), fData->size(), &info, NULL); |
if (fErrorInDecoding) { |
+ // In case a previous call to allocAndPinCache succeeded. |
+ fImageCache->throwAwayCache(fCacheId); |
fCacheId = SkImageCache::UNINITIALIZED_ID; |
return NULL; |
} |