[Scummvm-cvs-logs] scummvm master -> d50e7af797266e20dda17a80a45c1af45b176d3d

dhewg dhewg at wiibrew.org
Tue Apr 5 18:29:04 CEST 2011


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
d50e7af797 ANDROID: Fix endless loop in AndroidAssetArchive


Commit: d50e7af797266e20dda17a80a45c1af45b176d3d
    https://github.com/scummvm/scummvm/commit/d50e7af797266e20dda17a80a45c1af45b176d3d
Author: dhewg (dhewg at wiibrew.org)
Date: 2011-04-05T09:25:37-07:00

Commit Message:
ANDROID: Fix endless loop in AndroidAssetArchive

Can happen on empty member filenames, seen on some Samsung firmwares.

Changed paths:
    backends/platform/android/asset-archive.cpp



diff --git a/backends/platform/android/asset-archive.cpp b/backends/platform/android/asset-archive.cpp
index 26b1a6a..8e95029 100644
--- a/backends/platform/android/asset-archive.cpp
+++ b/backends/platform/android/asset-archive.cpp
@@ -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);






More information about the Scummvm-git-logs mailing list