diff options
-rw-r--r-- | src/lib/tng_io.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/lib/tng_io.c b/src/lib/tng_io.c index 6b467a8..237db3e 100644 --- a/src/lib/tng_io.c +++ b/src/lib/tng_io.c @@ -15649,7 +15649,7 @@ tng_function_status DECLSPECDLLEXPORT tng_util_particle_data_next_frame_read } else { - if(data->n_frames == 1) + if(data->n_frames == 1 && frame_set->n_frames == 1) { i = data->last_retrieved_frame + 1; } @@ -15813,7 +15813,7 @@ tng_function_status DECLSPECDLLEXPORT tng_util_non_particle_data_next_frame_read } else { - if(data->n_frames == 1) + if(data->n_frames == 1 && frame_set->n_frames == 1) { i = data->last_retrieved_frame + 1; } @@ -17507,6 +17507,10 @@ tng_function_status DECLSPECDLLEXPORT tng_util_trajectory_next_frame_present_dat { data_frame = data->first_frame_with_data; } + if(data_frame >= frame_set->first_frame + frame_set->n_frames) + { + continue; + } frame_diff = data_frame - current_frame; if(frame_diff < 0) { @@ -17594,6 +17598,10 @@ tng_function_status DECLSPECDLLEXPORT tng_util_trajectory_next_frame_present_dat { data_frame = data->first_frame_with_data; } + if(data_frame >= frame_set->first_frame + frame_set->n_frames) + { + continue; + } frame_diff = data_frame - current_frame; if(frame_diff < 0) { |