summaryrefslogtreecommitdiffstats
path: root/media/mtp
diff options
context:
space:
mode:
authorMarco Nelissen <marcone@google.com>2014-06-23 08:15:13 -0700
committerMarco Nelissen <marcone@google.com>2014-06-23 08:15:13 -0700
commitebb1081a624a773a67c49b279c775e18e693c4fc (patch)
tree1e22436c4dc6418840e35c609d278f098fa947e3 /media/mtp
parentccaffa8df0e201da6bfabb6d616e62904cfb5534 (diff)
downloadframeworks_av-ebb1081a624a773a67c49b279c775e18e693c4fc.zip
frameworks_av-ebb1081a624a773a67c49b279c775e18e693c4fc.tar.gz
frameworks_av-ebb1081a624a773a67c49b279c775e18e693c4fc.tar.bz2
Fix buffer allocation
b/15293123 Change-Id: Icb3ceabf02a55bc931baaf388ce125db6332de0e
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);