You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Bound the pixels a picture marker check decodes #2616
When a picture marker's image is checked (layer.marker, a QGIS style's or project's raster image markers, the ArcGIS picture markers), it is decoded in full before it is scaled down to 700 px a side. Drawing it does the same. The only bounds are 20,000 px a side and 512 MiB of decoder memory (render/src/picture.rs).
A PNG of about 1.5 MiB can declare 11,000 × 11,000 px and decode to some 480 MB, which can take seconds on the thread that checks it. An import reads up to 64 MiB of base64 of marker images, so one crafted project could hold the window for a minute or more, with no Cancel.
The header gives the size without decoding (picture_size). Proposal: a cap on declared pixels for picture markers, in render/src/picture.rs so every caller gets it (for example 4,096 × 4,096: past it a marker is drawn as a circle, with a note saying why). Larger graphics' pictures keep their own limits. Raised in review of #2612.
Scope note: a cap per image alone still lets one file cost minutes (measured ~19 ns per pixel; 1,024 kept images at 2048² ≈ 80 s), and drawing could decode the same images again every frame. The fix decodes each marker image once for the run in one store shared by every thread, refusing an image past 2048 × 2048 px by area and past 256 megapixels declared / 128 MiB decoded for the run.
Activity
jgregoriorincon commentedon Nov 21, 2026
I'll take this, after #2612.
jgregoriorincon commentedon Nov 22, 2026
Scope note: a cap per image alone still lets one file cost minutes (measured ~19 ns per pixel; 1,024 kept images at 2048² ≈ 80 s), and drawing could decode the same images again every frame. The fix decodes each marker image once for the run in one store shared by every thread, refusing an image past 2048 × 2048 px by area and past 256 megapixels declared / 128 MiB decoded for the run.
fix(render): charge a marker image's scaled size and its compressed c…
fix(render): keep a marker image refused only for the run's budget, a…
fix(render): scale a marker image to the size it is charged for (open…
fix(render): one rule for a kept marker image refused only for the ru…
test(engine): a fixture for a marker image past its pixels, and the r…
fix(render): decode each picture marker image once a run, within pixe…