mirror of
https://github.com/libretro/scummvm.git
synced 2025-01-29 23:01:58 +00:00
ANDROID: Fix endless loop in AndroidAssetArchive
Can happen on empty member filenames, seen on some Samsung firmwares.
This commit is contained in:
parent
7ce3719587
commit
d50e7af797
@ -440,19 +440,22 @@ int AndroidAssetArchive::listMembers(Common::ArchiveMemberList &member_list) {
|
||||
for (jsize i = 0; i < env->GetArrayLength(jpathlist); ++i) {
|
||||
jstring elem = (jstring)env->GetObjectArrayElement(jpathlist, i);
|
||||
const char *p = env->GetStringUTFChars(elem, 0);
|
||||
Common::String thispath = dir;
|
||||
|
||||
if (!thispath.empty())
|
||||
thispath += "/";
|
||||
if (strlen(p)) {
|
||||
Common::String thispath = dir;
|
||||
|
||||
thispath += p;
|
||||
if (!thispath.empty())
|
||||
thispath += "/";
|
||||
|
||||
// Assume files have a . in them, and directories don't
|
||||
if (strchr(p, '.')) {
|
||||
member_list.push_back(getMember(thispath));
|
||||
++count;
|
||||
} else {
|
||||
dirlist.push_back(thispath);
|
||||
thispath += p;
|
||||
|
||||
// Assume files have a . in them, and directories don't
|
||||
if (strchr(p, '.')) {
|
||||
member_list.push_back(getMember(thispath));
|
||||
++count;
|
||||
} else {
|
||||
dirlist.push_back(thispath);
|
||||
}
|
||||
}
|
||||
|
||||
env->ReleaseStringUTFChars(elem, p);
|
||||
|
Loading…
x
Reference in New Issue
Block a user