@@ -401,14 +401,12 @@ int vcxk_display_bitmap(ulong addr, int x, int y)
unsigned char *dataptr;
bmp = (bmp_image_t *) addr;
- if ((bmp->header.signature[0] == 'B') &&
- (bmp->header.signature[1] == 'M')) {
- width = le32_to_cpu(bmp->header.width);
- height = le32_to_cpu(bmp->header.height);
- bpp = le16_to_cpu(bmp->header.bit_count);
-
- dataptr = (unsigned char *) bmp +
- le32_to_cpu(bmp->header.data_offset);
+ if (bmp_signature_valid(bmp)) {
+ width = bmp_get_width(bmp);
+ height = bmp_get_height(bmp);
+ bpp = bmp_get_bit_count(bmp);
+
+ dataptr = (unsigned char *) bmp + bmp_get_data_offset(bmp);
if (display_width < (width + x))
c_width = display_width - x;