const MAX_SVG_PIXMAP_DIMENSION: u32 = 5000;
Expand description
The current SVG stack relies on resvg
to provide the natural dimensions of
the SVG, which it automatically infers from the width/height/viewBox properties
of the SVG. Since these can be arbitrarily large, this can cause us to allocate
a pixmap with very large dimensions leading to the process being killed due to
memory exhaustion. For example, the /css/css-transforms/perspective-svg-001.html
test uses very large values for viewBox. Hence, we just clamp the maximum
width/height of the pixmap allocated for rasterization.