Skip to content

Commit

Permalink
Merge branch 'bufferoverrunfix' into 'master'
Browse files Browse the repository at this point in the history
Fix a buffer overrun in SemanticVisualiser

@mikesapi: Happy New Year! This bug is present in `master`, and it's important that it's fixed. Please could you check to make sure the fix builds on Linux before merging?

See merge request !173
  • Loading branch information
mikesapi committed Jan 4, 2016
2 parents 1b24e30 + 7859bed commit 8a4a77f
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ void SemanticVisualiser::render(const ITMLib::Objects::ITMScene<SpaintVoxel,ITMV
{
// Update the label colours in the memory block.
Vector3u *labelColoursData = m_labelColoursMB->GetData(MEMORYDEVICE_CPU);
for(size_t i = 0, size = labelColours.size(); i < size; ++i)
for(size_t i = 0, size = std::min(m_labelColoursMB->dataSize, labelColours.size()); i < size; ++i)
{
labelColoursData[i] = labelColours[i];
}
Expand Down

0 comments on commit 8a4a77f

Please sign in to comment.