summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorAndre Heider <a.heider@gmail.com>2013-11-05 00:01:01 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2013-11-06 09:59:04 +0100
commit9617cfecbe7d7f3648be7b2cf435e44eaed3a141 (patch)
treeec372eae46d3dfc09962936b5362ae8fd6d52c0e /lib
parent3ad17654675d1fc71f55dc77e7510d243bdfab38 (diff)
downloadbarebox-9617cfecbe7d7f3648be7b2cf435e44eaed3a141.tar.gz
barebox-9617cfecbe7d7f3648be7b2cf435e44eaed3a141.tar.xz
gui: convert the bmp renderer to respect line_length
Signed-off-by: Andre Heider <a.heider@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'lib')
-rw-r--r--lib/gui/bmp.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/gui/bmp.c b/lib/gui/bmp.c
index 6bf8cd000f..dcf30952d2 100644
--- a/lib/gui/bmp.c
+++ b/lib/gui/bmp.c
@@ -78,8 +78,8 @@ static int bmp_renderer(struct screen *sc, struct surface *s, struct image *img)
image = (char *)bmp +
le32_to_cpu(bmp->header.data_offset);
image += (img->height - y - 1) * img->width * (bits_per_pixel >> 3);
- adr = buf + ((y + starty) * sc->s.width + startx) *
- (sc->info.bits_per_pixel >> 3);
+ adr = buf + (y + starty) * sc->info.line_length +
+ startx * (sc->info.bits_per_pixel >> 3);
for (x = 0; x < width; x++) {
int pixel;
@@ -100,8 +100,8 @@ static int bmp_renderer(struct screen *sc, struct surface *s, struct image *img)
image = (char *)bmp +
le32_to_cpu(bmp->header.data_offset);
image += (img->height - y - 1) * img->width * (bits_per_pixel >> 3);
- adr = buf + ((y + starty) * sc->s.width + startx) *
- (sc->info.bits_per_pixel >> 3);
+ adr = buf + (y + starty) * sc->info.line_length +
+ startx * (sc->info.bits_per_pixel >> 3);
for (x = 0; x < width; x++) {
char *pixel;