[Webkit-unassigned] [Bug 68753] [WinCairo] BitmapImage::drawFrameMatchingSourceSize causes access violation if BitmapImage::frameAtIndex() returns NULL

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Sep 26 05:01:16 PDT 2011


https://bugs.webkit.org/show_bug.cgi?id=68753


Adam Roben (:aroben) <aroben at apple.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
 Attachment #108581|review?                     |review-
               Flag|                            |




--- Comment #2 from Adam Roben (:aroben) <aroben at apple.com>  2011-09-26 05:01:16 PST ---
(From update of attachment 108581)
View in context: https://bugs.webkit.org/attachment.cgi?id=108581&action=review

Is it possible to add a regression test for this? Perhaps via TestWebKitAPI?

> Source/WebCore/platform/graphics/win/ImageCairoWin.cpp:100
>      for (size_t i = 0; i < frames; ++i) {
>          cairo_surface_t* image = frameAtIndex(i);
> -        if (cairo_image_surface_get_height(image) == static_cast<size_t>(srcSize.height()) && cairo_image_surface_get_width(image) == static_cast<size_t>(srcSize.width())) {
> +        if (image && cairo_image_surface_get_height(image) == static_cast<size_t>(srcSize.height()) && cairo_image_surface_get_width(image) == static_cast<size_t>(srcSize.width())) {

I think this would be a little clearer using an early continue:

cairo_surface_t* image = frameAtIndex(i);
if (!image)
    continue;

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list