Skip to content
Snippets Groups Projects
Commit d2cbe429 authored by Raphael Grimm's avatar Raphael Grimm
Browse files

Clean up code

parent 1440991c
No related branches found
No related tags found
No related merge requests found
......@@ -539,7 +539,8 @@ namespace VirtualRobot
delete []compressedData;*/
CompressionBZip2Ptr bzip2(new CompressionBZip2(&file));
unsigned char* emptyData = new unsigned char[getSizeRot()];
memset(emptyData, 0, getSizeRot() * sizeof(unsigned char));
const auto blockSize = getSizeRot() * sizeof(unsigned char);
memset(emptyData, 0, blockSize);
for (unsigned int x = 0; x < sizes[0]; x++)
for (unsigned int y = 0; y < sizes[1]; y++)
......@@ -557,7 +558,7 @@ namespace VirtualRobot
dataBlock = (void*) emptyData;
}
if (!bzip2->write(dataBlock, getSizeRot() * sizeof(unsigned char)))
if (!bzip2->write(dataBlock, blockSize))
{
VR_ERROR << "Error writing to file.." << endl;
bzip2->close();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment