mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-02 18:08:58 +00:00
Bug 787722 - Prevent out-of-bounds read/writes under nsSVGFELightingElement::Filter. r=roc.
--HG-- extra : rebase_source : 8354ba5e16ca00a09a7b794b2408db63e76ca9df
This commit is contained in:
parent
3871d8f191
commit
81a90a8fd3
@ -149,7 +149,13 @@ nsSVGFE::SetupScalingFilter(nsSVGFilterInstance *aInstance,
|
||||
r.RoundOut();
|
||||
if (!gfxUtils::GfxRectToIntRect(r, &result.mDataRect))
|
||||
return result;
|
||||
|
||||
|
||||
// Rounding in the code above can mean that result.mDataRect is not contained
|
||||
// within the bounds of the surfaces that we're about to create. We must
|
||||
// clamp to these bounds to prevent out-of-bounds reads and writes:
|
||||
result.mDataRect.IntersectRect(result.mDataRect,
|
||||
nsIntRect(nsIntPoint(), scaledSize));
|
||||
|
||||
result.mSource = new gfxImageSurface(scaledSize,
|
||||
gfxASurface::ImageFormatARGB32);
|
||||
result.mTarget = new gfxImageSurface(scaledSize,
|
||||
|
Loading…
Reference in New Issue
Block a user