mirror of
https://github.com/openai/codex.git
synced 2026-11-25 23:30:49 +00:00
## 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