Skip to content

spirv-opt: Fix id overflow in ConvertToSampledImage#6339

Merged
s-perron merged 1 commit intoKhronosGroup:mainfrom
s-perron:id_overflow16
Oct 1, 2025
Merged

spirv-opt: Fix id overflow in ConvertToSampledImage#6339
s-perron merged 1 commit intoKhronosGroup:mainfrom
s-perron:id_overflow16

Conversation

@s-perron
Copy link
Collaborator

In ConvertImageVariableToSampledImage, the result of FindPointerToType is
not checked before being passed to MoveInstructionNextToType. This can
cause a crash if FindPointerToType returns 0.

This CL adds a check to ensure type_id is not 0 before calling
MoveInstructionNextToType. If type_id is 0, the function will return
false.

In ConvertImageVariableToSampledImage, the result of FindPointerToType is
not checked before being passed to MoveInstructionNextToType. This can
cause a crash if FindPointerToType returns 0.

This CL adds a check to ensure type_id is not 0 before calling
MoveInstructionNextToType. If type_id is 0, the function will return
false.
@s-perron s-perron requested a review from luciechoi September 23, 2025 15:23
@s-perron s-perron merged commit 01628d6 into KhronosGroup:main Oct 1, 2025
22 checks passed
@s-perron s-perron deleted the id_overflow16 branch November 27, 2025 19:45
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