mirror of
https://github.com/hrydgard/ppsspp.git
synced 2024-11-26 23:10:38 +00:00
Add paranoid error check when listing cameras
This commit is contained in:
parent
72e46acf14
commit
8810d95ab4
@ -1482,8 +1482,12 @@ std::vector<std::string> System_GetCameraDeviceList() {
|
||||
|
||||
for (int i = 0; i < arrayListObjectLen; i++) {
|
||||
jstring dev = static_cast<jstring>(getEnv()->CallObjectMethod(deviceListObject, arrayListGet, i));
|
||||
const char* cdev = getEnv()->GetStringUTFChars(dev, nullptr);
|
||||
deviceListVector.push_back(cdev);
|
||||
const char *cdev = getEnv()->GetStringUTFChars(dev, nullptr);
|
||||
if (!cdev) {
|
||||
getEnv()->DeleteLocalRef(dev);
|
||||
continue;
|
||||
}
|
||||
deviceListVector.push_back(std::string(cdev));
|
||||
getEnv()->ReleaseStringUTFChars(dev, cdev);
|
||||
getEnv()->DeleteLocalRef(dev);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user