diff options
| author | 2015-12-16 18:49:20 -0500 | |
|---|---|---|
| committer | 2016-02-05 17:20:20 -0500 | |
| commit | d171822dcecc7b234d63147270d21307605a6347 (patch) | |
| tree | 9138152afe52b4d2f098f620a44afcedd01a5d54 | |
| parent | gl_rasterizer: Remove unnecessary casts. (diff) | |
| download | yuzu-d171822dcecc7b234d63147270d21307605a6347.tar.gz yuzu-d171822dcecc7b234d63147270d21307605a6347.tar.xz yuzu-d171822dcecc7b234d63147270d21307605a6347.zip | |
command_processor: Add an assertion to ensure LUTs are not written past their boundaries.
| -rw-r--r-- | src/video_core/command_processor.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/video_core/command_processor.cpp b/src/video_core/command_processor.cpp index 7409534b6..6540ccb26 100644 --- a/src/video_core/command_processor.cpp +++ b/src/video_core/command_processor.cpp | |||
| @@ -474,6 +474,9 @@ static void WritePicaReg(u32 id, u32 value, u32 mask) { | |||
| 474 | case PICA_REG_INDEX_WORKAROUND(lighting.lut_data[7], 0x1cf): | 474 | case PICA_REG_INDEX_WORKAROUND(lighting.lut_data[7], 0x1cf): |
| 475 | { | 475 | { |
| 476 | auto& lut_config = regs.lighting.lut_config; | 476 | auto& lut_config = regs.lighting.lut_config; |
| 477 | |||
| 478 | ASSERT_MSG(lut_config.index < 256, "lut_config.index exceeded maximum value of 255!"); | ||
| 479 | |||
| 477 | g_state.lighting.luts[lut_config.type][lut_config.index].raw = value; | 480 | g_state.lighting.luts[lut_config.type][lut_config.index].raw = value; |
| 478 | lut_config.index = lut_config.index + 1; | 481 | lut_config.index = lut_config.index + 1; |
| 479 | break; | 482 | break; |