diff --git a/libtorrent/src/storage.cpp b/libtorrent/src/storage.cpp index 8c8d62a68..fac91ef77 100755 --- a/libtorrent/src/storage.cpp +++ b/libtorrent/src/storage.cpp @@ -1248,7 +1248,8 @@ namespace libtorrent , block_size); crc.update(&buf[0], block_size); } - if (bi[num_blocks - 1].state == piece_picker::block_info::state_finished) + + if (num_blocks > 0 && bi[num_blocks - 1].state == piece_picker::block_info::state_finished) { m_storage->read( &buf[0]