Skip to content

body.style.zoom of about 350% or higher with side panels can cause "BitmapImpl has invalid row_bytes for configuration" crash #541

@JohnKlenk

Description

@JohnKlenk

I changed my app to have side panels, so there is a leftpanel, centerpanel, and rightpanel. When the center and right panels are showing, and I set the body.style.zoom to about 350% or higher, Ultralight crashes:
Check Failed: row_bytes >= (width_ * bpp_) @ C:\Users\ajs15\dev\Ultralight-SDK-trunk\deps\UltralightCore-src\src\Ultralight\Bitmap.cc (255) BitmapImpl has invalid row_bytes for configuration

It happens when using either grid layout or float:left for the panels. I had ChatGPT make me a test page but it wouldn't happen with that in the UL sample browser.

ChatGPT says:

Ultralight is trying to allocate a bitmap for a render surface (usually a layer or paint buffer), but the row stride (row_bytes) computed from zoomed layout math ended up smaller than the actual pixel width × bytes-per-pixel (bpp).

That happens when the computed layout width overflows (wraps around) an integer boundary or rounds incorrectly at high zoom — most often due to one of these:

  • Zoom > ~350% causes body.style.zoom to multiply clientWidth enough that a layout width > 16384 pixels (or similar internal limit) occurs.
  • Subpixel rounding or a negative value sneaks in after scaling, leading to a mismatch between width_ and row_bytes.
  • One of the panels (often right panel) ends up computed with a slightly negative or zero width due to floating-point rounding under zoom.

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