diff --git a/dom/canvas/ImageUtils.cpp b/dom/canvas/ImageUtils.cpp index ff8e59abfb76..3964b22d6a00 100644 --- a/dom/canvas/ImageUtils.cpp +++ b/dom/canvas/ImageUtils.cpp @@ -117,7 +117,8 @@ public: virtual uint32_t GetBufferLength() const { - const uint32_t stride = Surface()->Stride(); + DataSourceSurface::ScopedMap map(Surface(), DataSourceSurface::READ); + const uint32_t stride = map.GetStride(); const IntSize size = Surface()->GetSize(); return (uint32_t)(size.height * stride); }