Skip to content

Fix 16-bit RGB PNG loaded with 8-bit texture format in WICFileIO#136

Open
CodeReclaimers wants to merge 1 commit intodavideberly:masterfrom
CodeReclaimers:fix/wicfileio-16bit-rgb
Open

Fix 16-bit RGB PNG loaded with 8-bit texture format in WICFileIO#136
CodeReclaimers wants to merge 1 commit intodavideberly:masterfrom
CodeReclaimers:fix/wicfileio-16bit-rgb

Conversation

@CodeReclaimers
Copy link
Contributor

Summary

  • In WICFileIO::Load, the bit_depth==16 / PNG_COLOR_TYPE_RGB branch allocated the texture with DF_R8G8B8A8_UNORM instead of DF_R16G16B16A16_UNORM, causing a buffer overrun when writing uint16_t data.

Test plan

  • Code inspection: the 8-bit RGB branch correctly uses DF_R8G8B8A8_UNORM; the 16-bit RGBA/GRAY/GA branches all use 16-bit formats; only the 16-bit RGB branch was wrong.

🤖 Generated with Claude Code

In the bit_depth==16 / PNG_COLOR_TYPE_RGB branch, the texture was
allocated with DF_R8G8B8A8_UNORM instead of DF_R16G16B16A16_UNORM,
causing a buffer overrun when writing uint16_t data.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant