loadIntoBitmapTable never returns an error with invalid path

,

This is on SDK-2.2.0.

When calling loadIntoBitmapTable with an invalid path, no error is returned. Then the table is filled with whatever garbage was in memory when allocated.

Very easy to reproduce, just pass any non existing file path value to loadIntoBitmapTable.

#define LOG(x, ...) pd->system->logToConsole((x), ##__VA_ARGS__)
LCDBitmapTable* load_table(void) {
  LCDBitmapTable* table = pd->graphics->newBitmapTable(10, 24, 24);
  if (table == NULL) return NULL;

  pd->graphics->loadIntoBitmapTable("GARBAGE", table, &err);
  LOG("%s",err); // Always NULL, even when GARBAGE-table-24-24.png does not exist
  if (err == NULL) return table;
  return NULL;
}

The problem is not present with loadBitmapTable. If a non existing file is passed, an appropriate error is produced:

file GARBAGE not found: No such file

Thanks for the report, we'll get it fixed up.

1 Like

I confirm this is fixed in 2.3.0.
Thanks.

1 Like

Great, thanks again for reporting it!