Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions libs/filaflat/src/MaterialChunk.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,9 @@ bool MaterialChunk::getTextShader(Unflattener unflattener,
if (!unflattener.read(&shaderSize)){
return false;
}
if (shaderSize == 0) {
return false;
}

// Read how many lines there are.
uint32_t lineCount = 0;
Expand Down
5 changes: 4 additions & 1 deletion libs/image/src/Ktx1Bundle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,10 @@ Ktx1Bundle::Ktx1Bundle(uint32_t numMipLevels, uint32_t arrayLength, bool isCubem
mNumMipLevels = numMipLevels;
mArrayLength = arrayLength;
mNumCubeFaces = isCubemap ? 6 : 1;
mBlobs->sizes.resize(numMipLevels * arrayLength * mNumCubeFaces);
uint64_t const totalBlobs = (uint64_t)numMipLevels * arrayLength * mNumCubeFaces;
FILAMENT_CHECK_POSTCONDITION(totalBlobs <= (uint64_t)std::numeric_limits<uint32_t>::max())
<< "KTX dimensions overflow";
mBlobs->sizes.resize((uint32_t)totalBlobs);
}

Ktx1Bundle::Ktx1Bundle(uint8_t const* bytes, uint32_t nbytes) :
Expand Down