Skip to content

Commit 56f41df

Browse files
alfonsosanchezbeatosofar
authored andcommitted
bugfix: avoid crash in svg_ps_bars
The crash might be happening due to the previous low max pids number, but it is worth to avoid it nonetheless.
1 parent d9aee98 commit 56f41df

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/svg.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1184,7 +1184,8 @@ static void svg_ps_bars(FILE *of,
11841184

11851185
/* need to know last node first */
11861186
ps->sample = ps->first;
1187-
i = ps->sample->next->sampledata->counter;
1187+
if (ps->sample->next)
1188+
i = ps->sample->next->sampledata->counter;
11881189

11891190
while (ps->sample->next && i<(n_samples-(arg_hz/2))) {
11901191
double crt;

0 commit comments

Comments
 (0)