1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-29 14:00:49 +03:00

0031333: Data Exchange - RWGltf_TriangulationReader::readBuffer() fails to read interleaved buffer at the end of file

Standard_ReadBuffer has been extended with a flag for reading an interleaved data.
RWGltf_TriangulationReader::readBuffer() uses new flag for reading vertex attributes.
This commit is contained in:
kgv
2020-01-30 17:10:29 +03:00
committed by bugmaster
parent 62beabff7c
commit e2550e48f1
2 changed files with 22 additions and 10 deletions

View File

@@ -283,7 +283,7 @@ bool RWGltf_TriangulationReader::readBuffer (std::istream& theStream,
return false;
}
Standard_ReadBuffer aBuffer (theAccessor.Count * aStride, aStride);
Standard_ReadBuffer aBuffer (theAccessor.Count * aStride - (aStride - sizeof(Graphic3d_Vec3)), aStride, true);
if (!myCoordSysConverter.IsEmpty())
{
for (Standard_Integer aVertIter = 0; aVertIter < aNbNodes; ++aVertIter)
@@ -336,7 +336,7 @@ bool RWGltf_TriangulationReader::readBuffer (std::istream& theStream,
{
return false;
}
Standard_ReadBuffer aBuffer (theAccessor.Count * aStride, aStride);
Standard_ReadBuffer aBuffer (theAccessor.Count * aStride - (aStride - sizeof(Graphic3d_Vec3)), aStride, true);
if (!myCoordSysConverter.IsEmpty())
{
for (Standard_Integer aVertIter = 0; aVertIter < aNbNodes; ++aVertIter)
@@ -402,7 +402,7 @@ bool RWGltf_TriangulationReader::readBuffer (std::istream& theStream,
return false;
}
Standard_ReadBuffer aBuffer (theAccessor.Count * aStride, aStride);
Standard_ReadBuffer aBuffer (theAccessor.Count * aStride - (aStride - sizeof(Graphic3d_Vec2)), aStride, true);
for (int aVertIter = 0; aVertIter < aNbNodes; ++aVertIter)
{
Graphic3d_Vec2* aVec2 = aBuffer.ReadChunk<Graphic3d_Vec2> (theStream);