rk_fb: bmp_helper: copy bmp data with memcpy

Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
This commit is contained in:
Mark Yao
2014-12-29 15:03:49 +08:00
parent 963a9aa886
commit bef88e87a3

View File

@@ -339,7 +339,7 @@ int bmpdecoder(void *bmp_addr, void *pdst, int *width, int *height, int *bits)
uint16_t linesize;
char *src = bmp_addr;
char *dst = pdst;
int i, j;
int i;
bool flip = false;
memcpy(&header, src, sizeof(header));
@@ -388,13 +388,9 @@ int bmpdecoder(void *bmp_addr, void *pdst, int *width, int *height, int *bits)
src += (*width) * (*height - 1) * 3;
for (i = 0; i < *height; i++) {
for (j = 0; j < *width; j++) {
dst[0] = src[2];
dst[1] = src[1];
dst[2] = src[0];
dst += 3;
src += 3;
}
memcpy(dst, src, 3 * (*width));
dst += *width * 3;
src += *width * 3;
if (flip)
src -= *width * 3 * 2;
}