Ver Fonte

Cleanup.

Branimir Karadžić há 9 anos atrás
pai
commit
ff669aceab
2 ficheiros alterados com 6 adições e 2 exclusões
  1. 5 1
      src/shader_spirv.cpp
  2. 1 1
      src/shader_spirv.h

+ 5 - 1
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);

+ 1 - 1
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);