diff --git a/image/src/imgFrame.cpp b/image/src/imgFrame.cpp index f9b3933d2..54a863672 100644 --- a/image/src/imgFrame.cpp +++ b/image/src/imgFrame.cpp @@ -836,7 +836,13 @@ imgFrame::LockImageData() return NS_OK; } - return Deoptimize(); + double imgPixelSize = mSize.width * mSize.height; + if (imgPixelSize < (8092 * 8092)) { + // We should be safe to Deoptimize at this size (<64Mpix) + return Deoptimize(); + } + + return NS_ERROR_FAILURE; } nsresult