From d55fff555c65f40e0ca299711f11e60105281104 Mon Sep 17 00:00:00 2001 From: Marcos Pinto Date: Wed, 3 Oct 2007 18:33:32 +0000 Subject: [PATCH] storage fix --- libtorrent/src/storage.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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]