diff options
author | Hisham Muhammad <hisham@gobolinux.org> | 2018-02-18 10:17:56 -0300 |
---|---|---|
committer | Hisham Muhammad <hisham@gobolinux.org> | 2018-02-18 10:17:56 -0300 |
commit | ff78a1bfcea625aa19beea1747cd797efad90991 (patch) | |
tree | d9b80f1498b0e17a2d00ce7a15dfb09aee75fe56 /Meter.c | |
parent | f4f35da7e07b15af95f093ae5a95078e70e21123 (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.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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); |