OpenCV Manager crashes with exception (Bug #2660)

String checking and range cheching added.
pull/259/head
Alexander Smorkalov 12 years ago
parent 014a500f79
commit 064bf167ad
  1. 12
      android/service/engine/src/org/opencv/engine/manager/ManagerActivity.java

@ -402,10 +402,16 @@ public class ManagerActivity extends Activity
protected String NormalizeVersion(String OpenCVersion, String PackageVersion)
{
if (OpenCVersion == null || PackageVersion == null)
return "unknown";
int dot = PackageVersion.indexOf(".");
return OpenCVersion.substring(0, OpenCVersion.length()-1) + "." +
OpenCVersion.toCharArray()[OpenCVersion.length()-1] + "." +
PackageVersion.substring(0, dot) + " rev " + PackageVersion.substring(dot+1);
if (dot == -1 || OpenCVersion.length() == 0)
return "unknown";
else
return OpenCVersion.substring(0, OpenCVersion.length()-1) + "." +
OpenCVersion.toCharArray()[OpenCVersion.length()-1] + "." +
PackageVersion.substring(0, dot) + " rev " + PackageVersion.substring(dot+1);
}
protected String ConvertPackageName(String Name, String Version)

Loading…
Cancel
Save