Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(333)

Unified Diff: src/lazy/SkLazyPixelRef.cpp

Issue 12398021: If Ashmem cache fails pinCache, do not reallocate. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Fix an old type Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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;
}

Powered by Google App Engine
This is Rietveld 408576698