Loading gfx/2d/DrawTargetSkia.cpp +7 −2 Original line number Diff line number Diff line Loading @@ -29,6 +29,7 @@ #include "skia/src/core/SkWriteBuffer.h" #include "skia/src/shaders/SkEmptyShader.h" #include "Blur.h" #include "DataSurfaceHelpers.h" #include "Logging.h" #include "Tools.h" #include "PathHelpers.h" Loading Loading @@ -1814,12 +1815,16 @@ bool DrawTargetSkia::Init(const IntSize& aSize, SurfaceFormat aFormat) { } SkSurfaceProps props(0, GetSkPixelGeometry()); size_t bufSize = BufferSizeFromStrideAndHeight(stride.value(), info.height()); if (!bufSize) { return false; } if (aFormat == SurfaceFormat::A8) { // Skia does not fully allocate the last row according to stride. // Since some of our algorithms (i.e. blur) depend on this, we must allocate // the bitmap pixels manually. CheckedInt<size_t> size = stride; size *= info.height(); CheckedInt<size_t> size = bufSize; // We need to leave room for an additional 3 bytes for a potential overrun // in our blurring code. size += 3; Loading Loading
gfx/2d/DrawTargetSkia.cpp +7 −2 Original line number Diff line number Diff line Loading @@ -29,6 +29,7 @@ #include "skia/src/core/SkWriteBuffer.h" #include "skia/src/shaders/SkEmptyShader.h" #include "Blur.h" #include "DataSurfaceHelpers.h" #include "Logging.h" #include "Tools.h" #include "PathHelpers.h" Loading Loading @@ -1814,12 +1815,16 @@ bool DrawTargetSkia::Init(const IntSize& aSize, SurfaceFormat aFormat) { } SkSurfaceProps props(0, GetSkPixelGeometry()); size_t bufSize = BufferSizeFromStrideAndHeight(stride.value(), info.height()); if (!bufSize) { return false; } if (aFormat == SurfaceFormat::A8) { // Skia does not fully allocate the last row according to stride. // Since some of our algorithms (i.e. blur) depend on this, we must allocate // the bitmap pixels manually. CheckedInt<size_t> size = stride; size *= info.height(); CheckedInt<size_t> size = bufSize; // We need to leave room for an additional 3 bytes for a potential overrun // in our blurring code. size += 3; Loading