Fix crash on partial model load (model select)

This commit is contained in:
Raphael Coeffic
2021-11-10 11:05:47 +01:00
parent 94764d8fa9
commit a4701ef988
+7
View File
@@ -138,6 +138,13 @@ const char * readModel(const char * filename, uint8_t * buffer, uint32_t size, u
// YAML reader
TRACE("YAML model reader");
if (size < sizeof(g_model)) {
// TODO: Partial load for ModelButton::load()
// -> maybe we should have a summary in modelslist.yml?
memset(buffer, 0, size);
return nullptr;
}
char path[256];
getModelPath(path, filename);