summaryrefslogtreecommitdiffstats
path: root/media/mtp
diff options
context:
space:
mode:
authorMarco Nelissen <marcone@google.com>2014-06-23 18:23:22 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2014-06-20 21:00:34 +0000
commitda69fdbbeb79885a3c063a2017bd6d2848fcc312 (patch)
tree1e22436c4dc6418840e35c609d278f098fa947e3 /media/mtp
parentccaffa8df0e201da6bfabb6d616e62904cfb5534 (diff)
parentebb1081a624a773a67c49b279c775e18e693c4fc (diff)
downloadframeworks_av-da69fdbbeb79885a3c063a2017bd6d2848fcc312.zip
frameworks_av-da69fdbbeb79885a3c063a2017bd6d2848fcc312.tar.gz
frameworks_av-da69fdbbeb79885a3c063a2017bd6d2848fcc312.tar.bz2
Merge "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);