Skip to content

Commit abf77ff

Browse files
authored
Merge pull request #2131 from SergioRAgostinho/issue-2107
Prevent POINTS field parsing before point_step is specified
2 parents 23672ff + c00e702 commit abf77ff

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

io/src/pcd_io.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -317,6 +317,8 @@ pcl::PCDReader::readHeader (std::istream &fs, pcl::PCLPointCloud2 &cloud,
317317
// Get the number of points
318318
if (line_type.substr (0, 6) == "POINTS")
319319
{
320+
if (!cloud.point_step)
321+
throw "Number of POINTS specified before COUNT in header!";
320322
sstream >> nr_points;
321323
// Need to allocate: N * point_step
322324
cloud.data.resize (nr_points * cloud.point_step);

0 commit comments

Comments
 (0)