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

Unified Diff: webkit/port/platform/graphics/ImageSourceSkia.cpp

Issue 11580: Fix crashes while displaying large animated GIFs. Our old understanding of t... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 12 years, 1 month 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
« no previous file with comments | « webkit/port/platform/graphics/ImageSkia.cpp ('k') | webkit/port/platform/image-decoders/ImageDecoder.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/port/platform/graphics/ImageSourceSkia.cpp
===================================================================
--- webkit/port/platform/graphics/ImageSourceSkia.cpp (revision 5830)
+++ webkit/port/platform/graphics/ImageSourceSkia.cpp (working copy)
@@ -172,7 +172,11 @@
RGBA32Buffer* buffer = m_decoder->frameBufferAtIndex(index);
if (!buffer || buffer->status() == RGBA32Buffer::FrameEmpty)
return 0;
- return reinterpret_cast<NativeImagePtr>(&buffer->bitmap());
+
+ // Copy the bitmap. The pixel data is refcounted internally by SkBitmap, so
+ // this doesn't cost much. This pointer will be owned by the BitmapImage
+ // and freed in FrameData::clear().
+ return new NativeImageSkia(buffer->bitmap());
}
bool ImageSource::frameIsCompleteAtIndex(size_t index)
« no previous file with comments | « webkit/port/platform/graphics/ImageSkia.cpp ('k') | webkit/port/platform/image-decoders/ImageDecoder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698