ANDROID: Fix endless loop in AndroidAssetArchive

Can happen on empty member filenames, seen on some Samsung firmwares.
This commit is contained in:
dhewg 2011-04-05 18:25:37 +02:00
parent 7ce3719587
commit d50e7af797

View File

@ -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);