Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit da69fdbb authored by Marco Nelissen's avatar Marco Nelissen Committed by Gerrit Code Review
Browse files

Merge "Fix buffer allocation"

parents ccaffa8d ebb1081a
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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);