diff options
Diffstat (limited to 'media/mtp/MtpDevice.cpp')
-rw-r--r-- | media/mtp/MtpDevice.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/media/mtp/MtpDevice.cpp b/media/mtp/MtpDevice.cpp index 4ea8849..2e86159 100644 --- a/media/mtp/MtpDevice.cpp +++ b/media/mtp/MtpDevice.cpp @@ -819,6 +819,10 @@ MtpResponseCode MtpDevice::readResponse() { return mResponse.getResponseCode(); } int ret = mResponse.read(mRequestIn1); + // handle zero length packets, which might occur if the data transfer + // ends on a packet boundary + if (ret == 0) + ret = mResponse.read(mRequestIn1); if (ret >= MTP_CONTAINER_HEADER_SIZE) { mResponse.dump(); return mResponse.getResponseCode(); |