[Horus] Array initialization when loading a bitmap fails

This commit is contained in:
Bertrand Songis
2016-02-16 18:51:37 +01:00
parent 5853ac635f
commit 6db97c573b
+4 -2
View File
@@ -196,6 +196,10 @@ const char * bmpLoad(uint8_t * bmp, const char * filename, uint16_t width, uint1
uint8_t palette[16]; uint8_t palette[16];
uint8_t bmpBuf[LCD_W]; /* maximum with LCD_W */ uint8_t bmpBuf[LCD_W]; /* maximum with LCD_W */
uint8_t *buf = &bmpBuf[0]; uint8_t *buf = &bmpBuf[0];
uint16_t * dest = (uint16_t *)bmp;
dest[0] = 0;
dest[1] = 0;
if (width > LCD_W) { if (width > LCD_W) {
return STR_INCOMPATIBLE; return STR_INCOMPATIBLE;
@@ -302,8 +306,6 @@ const char * bmpLoad(uint8_t * bmp, const char * filename, uint16_t width, uint1
} }
} }
uint16_t * dest = (uint16_t *)bmp;
*dest++ = w; *dest++ = w;
*dest++ = h; *dest++ = h;