fix part-file header allocation

This commit is contained in:
Arvid Norberg 2018-04-01 23:46:07 +02:00 committed by Arvid Norberg
parent 77102102d6
commit a5e0578c88
1 changed files with 2 additions and 2 deletions

View File

@ -98,7 +98,7 @@ namespace libtorrent
if (!ec)
{
// parse header
boost::scoped_array<boost::uint32_t> header(new boost::uint32_t[m_header_size]);
boost::scoped_array<boost::uint32_t> header(new boost::uint32_t[m_header_size / 4]);
file::iovec_t b = {header.get(), size_t(m_header_size) };
int n = m_file.readv(0, &b, 1, ec);
if (ec) return;
@ -396,7 +396,7 @@ namespace libtorrent
open_file(file::read_write, ec);
if (ec) return;
boost::scoped_array<boost::uint32_t> header(new boost::uint32_t[m_header_size]);
boost::scoped_array<boost::uint32_t> header(new boost::uint32_t[m_header_size / 4]);
using namespace libtorrent::detail;