* This issue occurs with the --add-jsontime for lines that are a constant value. In this case, the variable `im->gdes[vidx].step` is always 0, which results in a division by zero segmentation fault.
* Fix MacOS Build error (no SOCK_CLOEXEC on mac) @ensc fixes oetiker#1261
* Fix build on 32bits platforms (like armhf) when time_t is 64bits, fixes #1264
* Fix compilation on illumos @hadfl
+* Fix division by zero segfault when exporting a LINEx with a constant value
Features
--------
long vidx = im->gdes[ref_list[i]].vidx;
time_t now = *start + dst_row * *step;
- (*dstptr++) = im->gdes[vidx].data[(unsigned long)
- floor((double)
- (now -
- im->gdes[vidx].start)
- / im->gdes[vidx].step)
- * im->gdes[vidx].ds_cnt +
- im->gdes[vidx].ds];
-
+ if (im->gdes[vidx].step > 0) {
+ (*dstptr++) = im->gdes[vidx].data[(unsigned long)
+ floor((double) (now - im->gdes[vidx].start) / im->gdes[vidx].step) * im->gdes[vidx].ds_cnt + im->gdes[vidx].ds];
+ }
}
}