libpayload/drivers/video: Improve check in if condition

Coverity considers this a copy&paste error, and maybe it is. In any
case, it makes sense to check the variable that (if the condition is
true) is changed, and the values are the same before that test, so the
change is harmless.

Change-Id: I163c6a9f5baa05e715861dc19643b19a9c79c883
Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Found-by: Coverity Scan #1347376
Reviewed-on: https://review.coreboot.org/17837
Tested-by: build bot (Jenkins)
Reviewed-by: Martin Roth <martinroth@google.com>
This commit is contained in:
Patrick Georgi 2016-12-13 15:55:26 +01:00 committed by Patrick Georgi
parent 5250852b0f
commit 4134680d46
1 changed files with 1 additions and 1 deletions

View File

@ -322,7 +322,7 @@ static int draw_bitmap_v3(const struct vector *top_left,
for (d.y = 0; d.y < dim->height; d.y++, p.y += dir) { for (d.y = 0; d.y < dim->height; d.y++, p.y += dir) {
s0.y = d.y * scale->y.d / scale->y.n; s0.y = d.y * scale->y.d / scale->y.n;
s1.y = s0.y; s1.y = s0.y;
if (s0.y + 1 < dim_org->height) if (s1.y + 1 < dim_org->height)
s1.y++; s1.y++;
ty.d = scale->y.n; ty.d = scale->y.n;
ty.n = (d.y * scale->y.d) % scale->y.n; ty.n = (d.y * scale->y.d) % scale->y.n;