From ff669aceab9979f81593894d8127c26c43bb203e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Branimir=20Karad=C5=BEi=C4=87?= Date: Sat, 12 Nov 2016 21:44:33 -0800 Subject: [PATCH] Cleanup. --- src/shader_spirv.cpp | 6 +++++- src/shader_spirv.h | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/shader_spirv.cpp b/src/shader_spirv.cpp index a5809ae6c..1c90476c9 100644 --- a/src/shader_spirv.cpp +++ b/src/shader_spirv.cpp @@ -990,7 +990,11 @@ namespace bgfx break; default: - for (;size/4 != _instruction.length && _err->isOk(); ++currOp) + for ( + ; size/4 != _instruction.length + && _err->isOk() + && currOp < BX_COUNTOF(_instruction.operand) + ; ++currOp) { _instruction.operand[currOp].type = info.operands[currOp]; size += read(_reader, _instruction.operand[currOp], _err); diff --git a/src/shader_spirv.h b/src/shader_spirv.h index 9a7f4ccde..c2454e9cb 100644 --- a/src/shader_spirv.h +++ b/src/shader_spirv.h @@ -601,7 +601,7 @@ namespace bgfx bool hasType; bool hasResult; - SpvOperand operand[8]; + SpvOperand operand[10]; }; int32_t read(bx::ReaderI* _reader, SpvInstruction& _instruction, bx::Error* _err);