summaryrefslogtreecommitdiffstats
path: root/media/mtp
diff options
context:
space:
mode:
authorMarco Nelissen <marcone@google.com>2014-06-23 19:48:55 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2014-06-23 19:48:55 +0000
commit620f348faf3ce0c39e71338a005f1528765f4d1e (patch)
treeec59a47e23d0178a172eccd6bc951b15b2db04d5 /media/mtp
parent7f76c50257f131cb26c1c21ede2622cb7ad534bf (diff)
parentda69fdbbeb79885a3c063a2017bd6d2848fcc312 (diff)
downloadframeworks_av-620f348faf3ce0c39e71338a005f1528765f4d1e.zip
frameworks_av-620f348faf3ce0c39e71338a005f1528765f4d1e.tar.gz
frameworks_av-620f348faf3ce0c39e71338a005f1528765f4d1e.tar.bz2
am da69fdbb: Merge "Fix buffer allocation"
* commit 'da69fdbbeb79885a3c063a2017bd6d2848fcc312': Fix buffer allocation
Diffstat (limited to 'media/mtp')
-rw-r--r--media/mtp/MtpDataPacket.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/media/mtp/MtpDataPacket.cpp b/media/mtp/MtpDataPacket.cpp
index c4f87a0..e6e19e3 100644
--- a/media/mtp/MtpDataPacket.cpp
+++ b/media/mtp/MtpDataPacket.cpp
@@ -363,7 +363,7 @@ int MtpDataPacket::write(int fd) {
}
int MtpDataPacket::writeData(int fd, void* data, uint32_t length) {
- allocate(length);
+ allocate(length + MTP_CONTAINER_HEADER_SIZE);
memcpy(mBuffer + MTP_CONTAINER_HEADER_SIZE, data, length);
length += MTP_CONTAINER_HEADER_SIZE;
MtpPacket::putUInt32(MTP_CONTAINER_LENGTH_OFFSET, length);