зеркало из https://github.com/mozilla/gecko-dev.git
Bug 787722 - Prevent out-of-bounds read/writes under nsSVGFELightingElement::Filter. r=roc.
--HG-- extra : rebase_source : 8354ba5e16ca00a09a7b794b2408db63e76ca9df
This commit is contained in:
Родитель
3871d8f191
Коммит
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,
|
||||
|
|
Загрузка…
Ссылка в новой задаче