From f31099c04853f72a7a403e9f6ed979a1b86fb81a Mon Sep 17 00:00:00 2001 From: Alejandro Homs Puron Date: Fri, 4 Mar 2022 09:18:13 +0100 Subject: [PATCH] [IO] Fix H5 sparse writer frame index check --- include/lima/io/h5/writer.hpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/lima/io/h5/writer.hpp b/include/lima/io/h5/writer.hpp index 619dc1ef..3acb750d 100644 --- a/include/lima/io/h5/writer.hpp +++ b/include/lima/io/h5/writer.hpp @@ -604,7 +604,8 @@ namespace io void write_frame_idx(hsize_t frame_idx, unsigned int val) { - if (frame_idx >= m_nb_frames) + // The dimension of the frame_idx dataset is (nb_frames + 1) + if (frame_idx > m_nb_frames) LIMA_THROW_EXCEPTION(lima::hdf5_error("Frame number out of bound") << boost::errinfo_frame_idx(frame_idx)); -- GitLab