add assert to detect index out-of-range
This commit is contained in:
parent
f16d0b7953
commit
241e9fd25a
|
@ -334,6 +334,8 @@ namespace libtorrent
|
|||
end = int(p->blocks_in_piece);
|
||||
}
|
||||
|
||||
TORRENT_ASSERT(end <= p->blocks_in_piece);
|
||||
|
||||
// count number of blocks that would be flushed
|
||||
int num_blocks = 0;
|
||||
for (int i = end-1; i >= 0; --i)
|
||||
|
|
Loading…
Reference in New Issue