diff --git a/examples/common/bgfx_utils.cpp b/examples/common/bgfx_utils.cpp index cfa2df35..9b03d3d7 100644 --- a/examples/common/bgfx_utils.cpp +++ b/examples/common/bgfx_utils.cpp @@ -409,7 +409,9 @@ struct Mesh bx::AllocatorI* allocator = entry::getAllocator(); uint32_t chunk; - while (4 == bx::read(_reader, chunk) ) + bx::Error err; + while (4 == bx::read(_reader, chunk, &err) + && err.isOk() ) { switch (chunk) {