Commit d311e85b authored by Hisham's avatar Hisham
Browse files

Avoid crash on huge screens.

Fix by @Explorer09 (see discussion on #355).
parent c148907e
......@@ -407,7 +407,12 @@ static void GraphMeterMode_draw(Meter* this, int x, int y, int w) {
data->values[nValues - 1] = value;
}
for (int i = nValues - (w*2) + 2, k = 0; i < nValues; i+=2, k++) {
int i = nValues - (w*2) + 2, k = 0;
if (i < 0) {
k = -i/2;
i = 0;
}
for (; i < nValues; i+=2, k++) {
int pix = GraphMeterMode_pixPerRow * GRAPH_HEIGHT;
int v1 = CLAMP(data->values[i] * pix, 1, pix);
int v2 = CLAMP(data->values[i+1] * pix, 1, pix);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment