If Ashmem cache fails pinCache, do not reallocate.

Review URL: https://codereview.chromium.org/12398021

git-svn-id: http://skia.googlecode.com/svn/trunk@7973 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/src/lazy/SkLazyPixelRef.cpp b/src/lazy/SkLazyPixelRef.cpp
index a20b3c0..9ae22f2 100644
--- a/src/lazy/SkLazyPixelRef.cpp
+++ b/src/lazy/SkLazyPixelRef.cpp
@@ -88,6 +88,8 @@
     // 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;
     }