summaryrefslogtreecommitdiffstats
path: root/Meter.c
diff options
context:
space:
mode:
authorHisham Muhammad <hisham@gobolinux.org>2018-02-18 10:17:56 -0300
committerHisham Muhammad <hisham@gobolinux.org>2018-02-18 10:17:56 -0300
commitff78a1bfcea625aa19beea1747cd797efad90991 (patch)
treed9b80f1498b0e17a2d00ce7a15dfb09aee75fe56 /Meter.c
parentf4f35da7e07b15af95f093ae5a95078e70e21123 (diff)
Fix out-of-bounds read
Detected by Coverity: https://scan8.coverity.com/reports.htm#v13252/p10402/fileInstanceId=22093847&defectInstanceId=7543344&mergedDefectId=174181
Diffstat (limited to 'Meter.c')
-rw-r--r--Meter.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Meter.c b/Meter.c
index 0d561e41..05a4eb23 100644
--- a/Meter.c
+++ b/Meter.c
@@ -404,7 +404,7 @@ static void GraphMeterMode_draw(Meter* this, int x, int y, int w) {
k = -i/2;
i = 0;
}
- for (; i < nValues; i+=2, k++) {
+ for (; i < nValues - 1; i+=2, k++) {
int pix = GraphMeterMode_pixPerRow * GRAPH_HEIGHT;
int v1 = CLAMP((int) lround(data->values[i] * pix), 1, pix);
int v2 = CLAMP((int) lround(data->values[i+1] * pix), 1, pix);

© 2014-2024 Faster IT GmbH | imprint | privacy policy