From: Magnus Lundborg Date: Tue, 1 Jul 2014 10:09:14 +0000 (+0200) Subject: Fix bug causing reading next frame not to stop. X-Git-Url: http://biod.pnpi.spb.ru/gitweb/?a=commitdiff_plain;h=7e97b8c753fe49eaaf8db4cb708cf2bf64bfd842;p=alexxy%2Fgromacs.git Fix bug causing reading next frame not to stop. Corresponds to commit e6e85d562829bca in the TNG repo. Change-Id: I89ee3e7649c4cf832798d9e2ce61b397a1757579 --- diff --git a/src/external/tng_io/src/lib/tng_io.c b/src/external/tng_io/src/lib/tng_io.c index fa4d3e55bf..d0028bd69f 100644 --- a/src/external/tng_io/src/lib/tng_io.c +++ b/src/external/tng_io/src/lib/tng_io.c @@ -17379,6 +17379,10 @@ tng_function_status DECLSPECDLLEXPORT tng_util_particle_data_next_frame_read { return(stat); } + if(frame_set->first_frame + frame_set->n_frames - 1 < i) + { + return(TNG_FAILURE); + } i = frame_set->first_frame; } } @@ -17539,6 +17543,10 @@ tng_function_status DECLSPECDLLEXPORT tng_util_non_particle_data_next_frame_read { return(stat); } + if(frame_set->first_frame + frame_set->n_frames - 1 < i) + { + return(TNG_FAILURE); + } i = frame_set->first_frame; } }