From d0033f9966d0f9905f3f7102bcb7d677d598c2ef Mon Sep 17 00:00:00 2001 From: Max Lyon Date: Mon, 14 Dec 2015 11:55:28 +0100 Subject: [PATCH] fix crash in OMWriter when writing an empty mesh with colors --- src/OpenMesh/Core/IO/writer/OMWriter.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/OpenMesh/Core/IO/writer/OMWriter.cc b/src/OpenMesh/Core/IO/writer/OMWriter.cc index efb25147..b7af9ef2 100644 --- a/src/OpenMesh/Core/IO/writer/OMWriter.cc +++ b/src/OpenMesh/Core/IO/writer/OMWriter.cc @@ -248,7 +248,7 @@ bool _OMWriter_::write_binary(std::ostream& _os, BaseExporter& _be, } // ---------- write vertex color - if (_opt.check( Options::VertexColor ) && _be.has_vertex_colors() ) + if (_be.n_vertices() && _opt.check( Options::VertexColor ) && _be.has_vertex_colors() ) { Vec3uc c = _be.color(VertexHandle(0));