Various fixes
Stop loading themes missing smdh files - this was causing scroll crashes due to how the icon loading code was working. In the future we will include a message about how themes are skipped due to lacking smdh files. Invalid zips also caused the same issue and are also now being properly ignored Fix memory leak in the zip file loading code
This commit is contained in:
@@ -176,6 +176,7 @@ u32 zip_file_to_buf(char *file_name, u16 *zip_path, char **buf)
|
||||
archive_read_support_format_zip(a);
|
||||
|
||||
int r = archive_read_open_filename(a, path, 0x4000);
|
||||
free(path);
|
||||
if(r != ARCHIVE_OK)
|
||||
{
|
||||
DEBUG("Invalid zip being opened\n");
|
||||
|
||||
@@ -190,6 +190,24 @@ Result load_entries(const char * loading_path, Entry_List_s * list)
|
||||
if(!(dir_entry.attributes & FS_ATTRIBUTE_DIRECTORY) && strcmp(dir_entry.shortExt, "ZIP"))
|
||||
continue;
|
||||
|
||||
u16 path[0x106] = {0};
|
||||
struacat(path, loading_path);
|
||||
strucat(path, dir_entry.name);
|
||||
char * buf = NULL;
|
||||
|
||||
if (!strcmp(dir_entry.shortExt, "ZIP"))
|
||||
{
|
||||
u32 size = zip_file_to_buf("info.smdh", path, &buf);
|
||||
if (size == 0) continue;
|
||||
}
|
||||
else
|
||||
{
|
||||
struacat(path, "/info.smdh");
|
||||
u32 size = file_to_buf(fsMakePath(PATH_UTF16, path), ArchiveSD, &buf);
|
||||
if (size == 0) continue;
|
||||
}
|
||||
|
||||
free(buf);
|
||||
list->entries_count++;
|
||||
Entry_s * new_list = realloc(list->entries, list->entries_count * sizeof(Entry_s));
|
||||
if(new_list == NULL)
|
||||
|
||||
Reference in New Issue
Block a user