Bug 1551745 - Remove false positive rooting hazard calculating allocation size until there's a fix r=me
authorJon Coppeard <jcoppeard@mozilla.com>
Thu, 16 May 2019 12:41:10 +0100
changeset 532990 1be11bf256eea87f795b6cac5b3ee2656b98cc6f
parent 532989 3b622e5dea3a9472380cce2d042e7f1bccb8d606
child 532991 8f69c7eeb6fd147b0066756389b95a734be8ae86
push id11276
push userrgurzau@mozilla.com
push dateMon, 20 May 2019 13:11:24 +0000
treeherdermozilla-beta@847755a7c325 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersme
bugs1551745
milestone68.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1551745 - Remove false positive rooting hazard calculating allocation size until there's a fix r=me
dom/canvas/CanvasRenderingContext2D.cpp
--- a/dom/canvas/CanvasRenderingContext2D.cpp
+++ b/dom/canvas/CanvasRenderingContext2D.cpp
@@ -5653,20 +5653,18 @@ void CanvasPath::EnsurePathBuilder() con
   mPathBuilder = mPath->CopyToBuilder();
   mPath = nullptr;
 }
 
 size_t BindingJSObjectMallocBytes(CanvasRenderingContext2D* aContext) {
   int32_t width = aContext->GetWidth();
   int32_t height = aContext->GetHeight();
 
-  int32_t max = gfxPrefs::MaxCanvasSize();
-  if (width > max || height > max) {
-    return 0;
-  }
+  // TODO: Bug 1552137: No memory will be allocated if either dimension is
+  // greater than gfxPrefs::MaxCanvasSize(). We should check this here too.
 
   CheckedInt<uint32_t> bytes = CheckedInt<uint32_t>(width) * height * 4;
   if (!bytes.isValid()) {
     return 0;
   }
 
   return bytes.value();
 }