fix: crash loop on new chip (#45)
changes: skip reading bitmaps on invalid magic header
This commit is contained in:
committed by
GitHub
parent
a8b32e91b6
commit
68e4ce488d
@@ -43,6 +43,9 @@ uint16_t data_flash2newmem(uint8_t **chunk, uint32_t n)
|
|||||||
{
|
{
|
||||||
data_legacy_t *header = data_get_header(0);
|
data_legacy_t *header = data_get_header(0);
|
||||||
|
|
||||||
|
if (memcmp(header->header, "wang", 5))
|
||||||
|
return 0;
|
||||||
|
|
||||||
uint16_t size = bswap16(header->sizes[n]) * LED_ROWS;
|
uint16_t size = bswap16(header->sizes[n]) * LED_ROWS;
|
||||||
if (size == 0)
|
if (size == 0)
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
@@ -79,6 +79,9 @@ void play_splash(xbm_t *xbm, int col, int row)
|
|||||||
|
|
||||||
void load_bmlist()
|
void load_bmlist()
|
||||||
{
|
{
|
||||||
|
if (data_get_header(0) == 0) // There is no bitmap stored in flash
|
||||||
|
return; // skip
|
||||||
|
|
||||||
bm_t *curr_bm = bmlist_current();
|
bm_t *curr_bm = bmlist_current();
|
||||||
|
|
||||||
for (int i=0; i<8; i++) {
|
for (int i=0; i<8; i++) {
|
||||||
|
|||||||
Reference in New Issue
Block a user