Commit 4cb8f643 authored by beidson@apple.com's avatar beidson@apple.com

https://bugs.webkit.org/show_bug.cgi?id=58155 and part of <rdar://problem/9251767>

BitmapImage::getFirstCGImageRefOfSize fails if the frameCount hasn't been initialized from the image source.

Reviewed by Adam Roben.

* platform/graphics/cg/ImageCG.cpp:
(WebCore::BitmapImage::getFirstCGImageRefOfSize): Call frameCount() instead of accessing m_frames.size() to
  make sure the frames are properly tallied first.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@83339 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent a35eae8d
2011-04-08 Brady Eidson <beidson@apple.com>
Reviewed by Adam Roben.
https://bugs.webkit.org/show_bug.cgi?id=58155 and part of <rdar://problem/9251767>
BitmapImage::getFirstCGImageRefOfSize fails if the frameCount hasn't been initialized from the image source.
* platform/graphics/cg/ImageCG.cpp:
(WebCore::BitmapImage::getFirstCGImageRefOfSize): Call frameCount() instead of accessing m_frames.size() to
make sure the frames are properly tallied first.
2011-04-08 Benjamin Poulain <benjamin.poulain@nokia.com>
Reviewed by Andreas Kling.
......@@ -156,7 +156,8 @@ CGImageRef BitmapImage::getCGImageRef()
CGImageRef BitmapImage::getFirstCGImageRefOfSize(const IntSize& size)
{
for (size_t i = 0; i < m_frames.size(); ++i) {
size_t count = frameCount();
for (size_t i = 0; i < count; ++i) {
CGImageRef cgImage = frameAtIndex(i);
if (IntSize(CGImageGetWidth(cgImage), CGImageGetHeight(cgImage)) == size)
return cgImage;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment