title: Assertion block_size == b failed when reading an OpenMesh file
body: <p>When reading an OpenMesh file via</p>
  
  <pre><code>OpenMesh::EPropHandleT&lt;bool&gt; prop_feature_edge;
  mesh.add_property(prop_feature_edge, "feature");
  OpenMesh::IO::read_mesh(mesh, "testmesh.om");
  </code></pre>
  
  <p>I get the error</p>
  
  <pre><code>Assertion failed: block_size == b, file E:\JB\workspace\OpenMesh-Windows-Gitlab-master\c9e6b25f\src\OpenMesh\Core\IO\reader\OMReader.cc, line 564
  </code></pre>
  
  <p>I looked it up in the source, but do not really get what the assertion is checking there. The problem is probably related to how different properties of the mesh are stored/loaded, but the error message is not really helpful to see what went wrong.</p>
  
  <p>Note that the file path in the assertion comes from the openmesh binaries and not my project path. The assert is defined <a href="http://www.openmesh.org/svnrepo/OpenMesh/trunk/src/OpenMesh/Core/IO/reader/OMReader.cc" rel="nofollow noreferrer">in this source source</a>.</p>
  
  <p>The file was written using</p>
  
  <pre><code>OpenMesh::EPropHandleT&lt;bool&gt; prop_feature_edge;
  mesh.add_property(prop_feature_edge, "feature");
  mesh.property(prop_feature_edge).set_persistent(true);
  OpenMesh::IO::write_mesh(mesh, "testmesh.om");
  </code></pre>
  
  <p>In my testcase I write the mesh and re-read it again and it fails, so there should be no differences in byte order, default options or library versions.</p>
  
  <p>Relevant Stacktrace:</p>
  
  <pre><code>    myProgram.exe!OpenMesh::IO::_OMReader_::restore_binary_custom_data(class std::basic_istream&lt;char,struct std::char_traits&lt;char&gt; &gt; &amp;,class OpenMesh::BaseProperty *,unsigned __int64,bool)    Unknown
      myProgram.exe!OpenMesh::IO::_OMReader_::read_binary_edge_chunk(class std::basic_istream&lt;char,struct std::char_traits&lt;char&gt; &gt; &amp;,class OpenMesh::IO::BaseImporter &amp;,class OpenMesh::IO::Options &amp;,bool)   Unknown
      myProgram.exe!OpenMesh::IO::_OMReader_::read_binary(class std::basic_istream&lt;char,struct std::char_traits&lt;char&gt; &gt; &amp;,class OpenMesh::IO::BaseImporter &amp;,class OpenMesh::IO::Options &amp;)   Unknown
      myProgram.exe!OpenMesh::IO::_OMReader_::read(class std::basic_istream&lt;char,struct std::char_traits&lt;char&gt; &gt; &amp;,class OpenMesh::IO::BaseImporter &amp;,class OpenMesh::IO::Options &amp;)  Unknown
      myProgram.exe!OpenMesh::IO::_OMReader_::read(class std::basic_string&lt;char,struct std::char_traits&lt;char&gt;,class std::allocator&lt;char&gt; &gt; const &amp;,class OpenMesh::IO::BaseImporter &amp;,class OpenMesh::IO::Options &amp;)  Unknown
      myProgram.exe!OpenMesh::IO::_IOManager_::read(class std::basic_string&lt;char,struct std::char_traits&lt;char&gt;,class std::allocator&lt;char&gt; &gt; const &amp;,class OpenMesh::IO::BaseImporter &amp;,class OpenMesh::IO::Options &amp;) Unknown
      myProgram.exe!OpenMesh::IO::read_mesh&lt;OpenMesh::TriMesh_ArrayKernelT&lt;OpenMesh::DefaultTraits&gt; &gt;(OpenMesh::TriMesh_ArrayKernelT&lt;OpenMesh::DefaultTraits&gt; &amp; _mesh, const std::basic_string&lt;char,std::char_traits&lt;char&gt;,std::allocator&lt;char&gt; &gt; &amp; _filename, OpenMesh::IO::Options &amp; _opt, bool _clear) Line 141    C++
      myProgram.exe!main(int argc, char * * argv) Line 479    C++
      [External Code] 
  </code></pre>
  
  <p>So this really looks like some wrong size calculation in the custom properties.
  I copied the code adding custom properties and requesting existing ones (like face status and vertex colors) from writing the mesh just before reading the mesh to be sure to have the same mesh properties and it still crashes.</p>
  
  <p>Comparing the properties of the configured meshes they seem to be the same:</p>
  
  <pre><code>properties before writing
  3 vprops:
    v:points
    &lt;vprop&gt;
    v:colors
  1 hprops:
    &lt;hprop&gt;
  2 eprops:
    &lt;eprop&gt;
    feature, persistent
  2 fprops:
    &lt;fprop&gt;
    f:status
  0 mprops:
  #bytes written: 169006
  
  properties before reading
  3 vprops:
    v:points
    &lt;vprop&gt;
    v:colors
  1 hprops:
    &lt;hprop&gt;
  2 eprops:
    &lt;eprop&gt;
    feature, persistent
  2 fprops:
    &lt;fprop&gt;
    f:status
  0 mprops:
  </code></pre>