diff --git a/indra/newview/llmeshrepository.cpp b/indra/newview/llmeshrepository.cpp
index 19f2a01646587cd8c9037d653c307938f80680cb..3df4c8963e874b9c95c3d326832a4c9bb7efb5c3 100644
--- a/indra/newview/llmeshrepository.cpp
+++ b/indra/newview/llmeshrepository.cpp
@@ -3289,7 +3289,7 @@ void LLMeshHeaderHandler::processData(LLCore::BufferArray * /* body */, S32 /* b
 			LLFileSystem file(mesh_id, LLAssetType::AT_MESH, LLFileSystem::WRITE);
 			if (file.getMaxSize() >= padded_data.size())
 			{
-				LLMeshRepository::sCacheBytesWritten += padded_data.size();
+				LLMeshRepository::sCacheBytesWritten += data_size;
 				++LLMeshRepository::sCacheWrites;
 
 				file.write(padded_data.data(), padded_data.size());