Stop trying to apply HQ scaling on ridiculously-sized (>64Mpix) images since it'll cause OOM crashes.

Too-large images won't use HQ scaling and also won't display at 1:1 zoom
because we simply don't have the surface cache space available for that kind of out-of-scope image.
It will allow the user to save such images to disk and view in specialized software.
This commit is contained in:
Pale Moon
2017-03-20 01:41:15 +01:00
parent 86ca45837d
commit c6b3fd0aa5
+7 -1
View File
@@ -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