Skip to content

Comments

Fix FloatRGB#281

Closed
neptuwunium wants to merge 1 commit intoFabianFG:masterfrom
neptuwunium:fix/floatrgb
Closed

Fix FloatRGB#281
neptuwunium wants to merge 1 commit intoFabianFG:masterfrom
neptuwunium:fix/floatrgb

Conversation

@neptuwunium
Copy link
Contributor

@neptuwunium neptuwunium commented Dec 13, 2025

It's 6 bytes (half is 2 bytes, 3 components, 2 * 3 = 6 bytes), not 4. Causes an out of bounds read otherwise.

Seen in Steel Hunters (ProjectR3/Content/Environment/Light/Default_EngineSky/T_Clouds_Terra3_8k01_seq049_x1109.uasset)

@LongerWarrior
Copy link
Collaborator

https://github.com/EpicGames/UnrealEngine/blob/50a0f621c150af84c191ff411c382fcf1126a19d/Engine/Source/Runtime/Core/Public/PixelFormat.h#L26
it's PF_FloatR11G11B10, so 4 bytes is correct
also that asset in Steel Hunters uses PF_BC6H

@neptuwunium
Copy link
Contributor Author

neptuwunium commented Jan 6, 2026

then

colorType = EPixelFormat.PF_FloatRGBA; //TODO idk

is wrong (causes buffer underflow)

and

pixelOffset *= 6; // 6 bytes per pixel (3x half16)

is also wrong (causes buffer overflow)

shrug

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.

2 participants