src/output/cairo-chart.h (xrchart_write_scale): Check the range and deal with the...
authorJohn Darrington <john@darrington.wattle.id.au>
Sat, 11 Jul 2020 07:35:29 +0000 (09:35 +0200)
committerJohn Darrington <john@darrington.wattle.id.au>
Sat, 11 Jul 2020 07:45:14 +0000 (09:45 +0200)
commit8f998d65fb573c1b4c12f917cc3dd0639808cfa3
tree1ddb695a27b5e6376fc9e2dc69355d9c57839fe3
parent174fe8e41ef09534218803189529cbd797750934
src/output/cairo-chart.h (xrchart_write_scale): Check the range and deal with the consequences.

If a chart was requested where either scale had an range of zero
(the minimum value and the maximum value were equal), then all
sorts of memory errors could occur later in the chart's rendering.

This change checks for this condition early and refuses to draw the
chart in this case.
src/output/cairo-chart.c
src/output/cairo-chart.h
src/output/charts/barchart-cairo.c
src/output/charts/boxplot-cairo.c
src/output/charts/np-plot-cairo.c
src/output/charts/plot-hist-cairo.c
src/output/charts/roc-chart-cairo.c
src/output/charts/scatterplot-cairo.c
src/output/charts/scree-cairo.c
src/output/charts/spreadlevel-cairo.c