summaryrefslogtreecommitdiffstats
path: root/media/mtp
diff options
context:
space:
mode:
authorMarco Nelissen <marcone@google.com>2014-06-23 19:54:07 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2014-06-23 19:54:07 +0000
commitc27f5259cf2c45ea6f0a021fc17578f32f6c2f7d (patch)
tree86ce7864cb48f85e5b26307d23554965ccfb14c2 /media/mtp
parent215ebcddf7216d15fde34f9a32d27f280d1b19d3 (diff)
parent620f348faf3ce0c39e71338a005f1528765f4d1e (diff)
downloadframeworks_av-c27f5259cf2c45ea6f0a021fc17578f32f6c2f7d.zip
frameworks_av-c27f5259cf2c45ea6f0a021fc17578f32f6c2f7d.tar.gz
frameworks_av-c27f5259cf2c45ea6f0a021fc17578f32f6c2f7d.tar.bz2
am 620f348f: am da69fdbb: Merge "Fix buffer allocation"
* commit '620f348faf3ce0c39e71338a005f1528765f4d1e': 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);