summaryrefslogtreecommitdiffstats
path: root/profile.c
diff options
context:
space:
mode:
Diffstat (limited to 'profile.c')
-rw-r--r--profile.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/profile.c b/profile.c
index 6eab3b240..065934746 100644
--- a/profile.c
+++ b/profile.c
@@ -1704,6 +1704,10 @@ static struct plot_info *create_plot_info(struct dive *dive, int nr_samples, str
int delay = 0;
struct sample *sample = dive_sample+i;
+ if (sample->time.seconds < dive->start || sample->time.seconds > dive->end) {
+ pi_idx--;
+ continue;
+ }
entry = pi->entry + i + pi_idx;
while (ceil_ev && ceil_ev->time.seconds <= sample->time.seconds) {
struct event *next_ceil_ev = get_next_event(ceil_ev->next, "ceiling");