Changeset 249375 in webkit


Ignore:
Timestamp:
Sep 1, 2019 11:03:07 PM (5 years ago)
Author:
Fujii Hironori
Message:

[Cairo] out-of-bounds read in ShareableBitmap::paint if a fractional device scale factor is used
https://bugs.webkit.org/show_bug.cgi?id=196340

Reviewed by Brent Fulgham.

In ShareableBitmap::paint, srcRectScaled can be out-of-bounds of
the surface if a fractional device scale factor is used.

  • Shared/cairo/ShareableBitmapCairo.cpp:

(WebKit::ShareableBitmap::paint): Use cairoSurfaceSetDeviceScale
to set a device scale factor to the surface instead of multiplying
srcRect with a device scale factor.

Location:
trunk/Source/WebKit
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/ChangeLog

    r249371 r249375  
     12019-09-01  Fujii Hironori  <Hironori.Fujii@sony.com>
     2
     3        [Cairo] out-of-bounds read in ShareableBitmap::paint if a fractional device scale factor is used
     4        https://bugs.webkit.org/show_bug.cgi?id=196340
     5
     6        Reviewed by Brent Fulgham.
     7
     8        In ShareableBitmap::paint, srcRectScaled can be out-of-bounds of
     9        the surface if a fractional device scale factor is used.
     10
     11        * Shared/cairo/ShareableBitmapCairo.cpp:
     12        (WebKit::ShareableBitmap::paint): Use cairoSurfaceSetDeviceScale
     13        to set a device scale factor to the surface instead of multiplying
     14        srcRect with a device scale factor.
     15
    1162019-09-01  Fujii Hironori  <Hironori.Fujii@sony.com>
    217
  • trunk/Source/WebKit/Shared/cairo/ShareableBitmapCairo.cpp

    r248846 r249375  
    7272{
    7373    RefPtr<cairo_surface_t> surface = createSurfaceFromData(data(), m_size);
     74    cairoSurfaceSetDeviceScale(surface.get(), scaleFactor, scaleFactor);
    7475    FloatRect destRect(dstPoint, srcRect.size());
    75     FloatRect srcRectScaled(srcRect);
    76     srcRectScaled.scale(scaleFactor);
    7776
    7877    ASSERT(context.hasPlatformContext());
    7978    auto& state = context.state();
    80     Cairo::drawSurface(*context.platformContext(), surface.get(), destRect, srcRectScaled, state.imageInterpolationQuality, state.alpha, Cairo::ShadowState(state));
     79    Cairo::drawSurface(*context.platformContext(), surface.get(), destRect, srcRect, state.imageInterpolationQuality, state.alpha, Cairo::ShadowState(state));
    8180}
    8281
Note: See TracChangeset for help on using the changeset viewer.