From 8b9849182a3b33406c4264b10a83e97555b375c7 Mon Sep 17 00:00:00 2001 From: Pavel Krajcevski Date: Fri, 28 Feb 2014 19:04:25 -0500 Subject: [PATCH] Add additional error check. --- ASTCEncoder/src/Decompressor.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/ASTCEncoder/src/Decompressor.cpp b/ASTCEncoder/src/Decompressor.cpp index ac222eb..c6ec9f0 100644 --- a/ASTCEncoder/src/Decompressor.cpp +++ b/ASTCEncoder/src/Decompressor.cpp @@ -304,6 +304,13 @@ namespace ASTCC { BitStreamReadOnly strm(inBuf); TexelWeightParams weightParams = DecodeBlockInfo(strm); + // Was there an error? + if(weightParams.m_bError) { + assert(!"Invalid block mode"); + FillError(outBuf, blockWidth, blockHeight); + return; + } + if(weightParams.m_Width > blockWidth) { assert(!"Texel weight grid width should be smaller than block width"); FillError(outBuf, blockWidth, blockHeight);