diff --git a/src/part_file.cpp b/src/part_file.cpp index bba8bb1cb..b842a2b8f 100644 --- a/src/part_file.cpp +++ b/src/part_file.cpp @@ -98,7 +98,7 @@ namespace libtorrent if (!ec) { // parse header - boost::scoped_array header(new boost::uint32_t[m_header_size]); + boost::scoped_array 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 header(new boost::uint32_t[m_header_size]); + boost::scoped_array header(new boost::uint32_t[m_header_size / 4]); using namespace libtorrent::detail;