From fb6d00c10a661584a88a8e55715e3d73a67dc3ac Mon Sep 17 00:00:00 2001 From: Lehman Garrison Date: Thu, 6 May 2021 12:36:30 -0700 Subject: [PATCH] Use the last block index in the file, in case the last data block also contains something that looks like a block index [#989] --- asdf/block.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/asdf/block.py b/asdf/block.py index c4ae3c797..34a5fbe9c 100644 --- a/asdf/block.py +++ b/asdf/block.py @@ -455,7 +455,7 @@ def read_block_index(self, fd, ctx): # Read blocks in reverse order from the end of the file while True: # Look for the index header - idx = content.find(constants.INDEX_HEADER) + idx = content.rfind(constants.INDEX_HEADER) if idx != -1: content = content[idx:] index_start = block_start + idx