summaryrefslogtreecommitdiffstats
path: root/mtp/mtp_MtpDatabase.cpp
diff options
context:
space:
mode:
authorEthan Yonker <dees_troy@teamw.in>2014-09-03 21:46:41 +0200
committerEthan Yonker <dees_troy@teamw.in>2014-09-03 22:06:00 +0200
commit5e083dcc202e53f21a9b2ca786d939abed090bde (patch)
treed1f098596f1b2146722d18f8abad6f405b32bbd9 /mtp/mtp_MtpDatabase.cpp
parentAllow toggle of MTP debug (diff)
downloadandroid_bootable_recovery-5e083dcc202e53f21a9b2ca786d939abed090bde.tar
android_bootable_recovery-5e083dcc202e53f21a9b2ca786d939abed090bde.tar.gz
android_bootable_recovery-5e083dcc202e53f21a9b2ca786d939abed090bde.tar.bz2
android_bootable_recovery-5e083dcc202e53f21a9b2ca786d939abed090bde.tar.lz
android_bootable_recovery-5e083dcc202e53f21a9b2ca786d939abed090bde.tar.xz
android_bootable_recovery-5e083dcc202e53f21a9b2ca786d939abed090bde.tar.zst
android_bootable_recovery-5e083dcc202e53f21a9b2ca786d939abed090bde.zip
Diffstat (limited to '')
-rwxr-xr-xmtp/mtp_MtpDatabase.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/mtp/mtp_MtpDatabase.cpp b/mtp/mtp_MtpDatabase.cpp
index 60a871ce3..acdab523d 100755
--- a/mtp/mtp_MtpDatabase.cpp
+++ b/mtp/mtp_MtpDatabase.cpp
@@ -322,7 +322,7 @@ MtpResponseCode MyMtpDatabase::getObjectPropertyValue(MtpObjectHandle handle,
MtpDataPacket& packet) {
MTPD("MyMtpDatabase::getObjectPropertyValue mtpid: %i, property: %x\n", handle, property);
int type;
- MtpResponseCode result;
+ MtpResponseCode result = MTP_RESPONSE_INVALID_OBJECT_HANDLE;
uint64_t longValue;
if (!getObjectPropertyInfo(property, type)) {
MTPE("MyMtpDatabase::setObjectPropertyValue returning MTP_RESPONSE_OBJECT_PROP_NOT_SUPPORTED\n");
@@ -336,6 +336,11 @@ MtpResponseCode MyMtpDatabase::getObjectPropertyValue(MtpObjectHandle handle,
}
}
+ if (result != MTP_RESPONSE_OK) {
+ MTPE("MyMtpDatabase::setObjectPropertyValue unable to locate handle: %i\n", handle);
+ return MTP_RESPONSE_INVALID_OBJECT_HANDLE;
+ }
+
// special case date properties, which are strings to MTP
// but stored internally as a uint64
if (property == MTP_PROPERTY_DATE_MODIFIED || property == MTP_PROPERTY_DATE_ADDED) {