diff options
Diffstat (limited to 'WebCore/platform/graphics/cg/ImageSourceCG.cpp')
-rw-r--r-- | WebCore/platform/graphics/cg/ImageSourceCG.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/WebCore/platform/graphics/cg/ImageSourceCG.cpp b/WebCore/platform/graphics/cg/ImageSourceCG.cpp index 0b5f0b0..9ad3166 100644 --- a/WebCore/platform/graphics/cg/ImageSourceCG.cpp +++ b/WebCore/platform/graphics/cg/ImageSourceCG.cpp @@ -202,14 +202,17 @@ int ImageSource::repetitionCount() if (!initialized()) return result; - // A property with value 0 means loop forever. RetainPtr<CFDictionaryRef> properties(AdoptCF, CGImageSourceCopyProperties(m_decoder, imageSourceOptions())); if (properties) { CFDictionaryRef gifProperties = (CFDictionaryRef)CFDictionaryGetValue(properties.get(), kCGImagePropertyGIFDictionary); if (gifProperties) { CFNumberRef num = (CFNumberRef)CFDictionaryGetValue(gifProperties, kCGImagePropertyGIFLoopCount); - if (num) + if (num) { + // A property with value 0 means loop forever. CFNumberGetValue(num, kCFNumberIntType, &result); + if (!result) + result = cAnimationLoopInfinite; + } } else result = cAnimationNone; // Turns out we're not a GIF after all, so we don't animate. } |