From 1f3f8bdbe6714c2c8ba02f9a819db5bcf80500a3 Mon Sep 17 00:00:00 2001 From: Joel Bodenmann Date: Fri, 17 Jan 2014 08:04:35 +0100 Subject: [PATCH] fixes in gdispImage nativ format by Marc Pignat --- src/gdisp/image_native.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gdisp/image_native.c b/src/gdisp/image_native.c index 72ae8b61..7f249ae8 100644 --- a/src/gdisp/image_native.c +++ b/src/gdisp/image_native.c @@ -107,7 +107,7 @@ gdispImageError gdispImageGDraw_NATIVE(GDisplay *g, gdispImage *img, coord_t x, } /* For this image decoder we cheat and just seek straight to the region we want to display */ - pos = FRAME0POS + (img->width * sy + cx) * sizeof(pixel_t); + pos = FRAME0POS + (img->width * sy + sx) * sizeof(pixel_t); /* Cycle through the lines */ for(;cy;cy--, y++) { @@ -119,7 +119,7 @@ gdispImageError gdispImageGDraw_NATIVE(GDisplay *g, gdispImage *img, coord_t x, // Read the data len = img->io.fns->read(&img->io, img->priv->buf, - mx > BLIT_BUFFER_SIZE ? (BLIT_BUFFER_SIZE*sizeof(pixel_t)) : (mx * sizeof(pixel_t))) + mcx > BLIT_BUFFER_SIZE ? (BLIT_BUFFER_SIZE*sizeof(pixel_t)) : (mcx * sizeof(pixel_t))) / sizeof(pixel_t); if (!len) return GDISP_IMAGE_ERR_BADDATA;