From cb8320945d11209928af498e4d64380b8372b02f Mon Sep 17 00:00:00 2001 From: PencilAmazing Date: Sun, 22 Jan 2023 19:51:36 -0500 Subject: [PATCH] Fix issue #4866 by continuing to resetting read loop after hitting a comment --- code/AssetLib/Ply/PlyParser.cpp | 4 ++-- test/models/PLY/issue623.ply | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/code/AssetLib/Ply/PlyParser.cpp b/code/AssetLib/Ply/PlyParser.cpp index c2b264b21..a7cf92606 100644 --- a/code/AssetLib/Ply/PlyParser.cpp +++ b/code/AssetLib/Ply/PlyParser.cpp @@ -308,8 +308,8 @@ bool PLY::Element::ParseElement(IOStreamBuffer &streamBuffer, std::vector< streamBuffer.getNextLine(buffer); pCur = (char *)&buffer[0]; - // skip all comments - PLY::DOM::SkipComments(buffer); + // skip all comments and go to next line + if (PLY::DOM::SkipComments(buffer)) continue; PLY::Property prop; if (!PLY::Property::ParseProperty(buffer, &prop)) diff --git a/test/models/PLY/issue623.ply b/test/models/PLY/issue623.ply index af8811752..6cff78e65 100644 --- a/test/models/PLY/issue623.ply +++ b/test/models/PLY/issue623.ply @@ -2,6 +2,7 @@ ply format ascii 1.0 comment Created by Blender 2.77 (sub 0) - www.blender.org, source file: '' element vertex 24 +comment Manually added comment line to fix issue #4866 property float x property float y property float z