Skip to content

Bound the pixels a picture marker check decodes #2616

Closed

Description

@jgregoriorincon

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.

Activity

  1. jgregoriorincon commented on Nov 21, 2026

    @jgregoriorincon
    ContributorAuthor

    I'll take this, after #2612.

  2. jgregoriorincon commented on Nov 22, 2026

    @jgregoriorincon
    ContributorAuthor

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions