Skip to content

Out-of-bounds memory access in random color choice #611

@nscottnichols

Description

@nscottnichols

In process_sigmaKin_function.inc on lines 64 and 175, channelIdC == -1 when channel enhancement is disabled (channelId == 0). This causes an out-of-bounds memory access on lines 72, 184, and 194 (mgOnGpu::icolamp[channelIdC][icolC]). Channel enhancement is always on in the full application (correct me if I'm wrong here) so this isn't a problem, but in the standalone, we hardcode channelId=0 on line 575 in check_sa.cc. The proposed fix is to simply hardcode channelId=1, in check_sa.cc. Or, we could protect the code with an if (channelIdC > 0), at the cost of the if statement.

The out-of-bounds memory access causes hangs when compiled for Nvidia devices in the SYCL code (no issues when compiled for devices from other vendors).

@valassi

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions