Files
codex/codex-rs/tui
Eric Traut 590be70f75 Fix pasting packed bitmap images on Windows (#63888)
## Why

When a packed `CF_DIBV5` bitmap stores pixels immediately after its
header, the clipboard decoder skips the first three pixels as if they
were additional color masks. This can cause a short read or shift the
image when the clipboard buffer includes trailing padding.

## What changed

For supported 32-bit `CF_DIBV5` bitmaps, supply an explicit BMP pixel
offset and enforce the decoder's allocation limits. Keep PNG as the
preferred clipboard format and handle bitmaps that repeat the color masks
before the pixels.

## Testing

Add a regression test for packed, padded, and repeated-mask bitmaps that
checks decoded RGBA values and allocation limits. The test also covers
missing pixel data.

GitOrigin-RevId: 7bb47a180584633c8a3f47c909b0e291d0003020
2026-11-25 11:50:14 +00:00
..