diff options
author | Marco Nelissen <marcone@google.com> | 2014-06-23 19:48:55 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2014-06-23 19:48:55 +0000 |
commit | 620f348faf3ce0c39e71338a005f1528765f4d1e (patch) | |
tree | ec59a47e23d0178a172eccd6bc951b15b2db04d5 /media/mtp | |
parent | 7f76c50257f131cb26c1c21ede2622cb7ad534bf (diff) | |
parent | da69fdbbeb79885a3c063a2017bd6d2848fcc312 (diff) | |
download | frameworks_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.cpp | 2 |
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); |