From 65043976627e419e6869c838a723770264ec3bc2 Mon Sep 17 00:00:00 2001 From: "Jeffrey S. Smith" Date: Fri, 24 Sep 2010 22:56:33 -0500 Subject: [PATCH] Fix bug in reading memo files larger than 16MiB --- openlp/plugins/songs/lib/ewimport.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/openlp/plugins/songs/lib/ewimport.py b/openlp/plugins/songs/lib/ewimport.py index 42efc011e..b2ef208e0 100644 --- a/openlp/plugins/songs/lib/ewimport.py +++ b/openlp/plugins/songs/lib/ewimport.py @@ -249,19 +249,20 @@ class EasyWorshipSongImport(SongImport): return (field ^ 0x80 == 1) elif field_desc.type == 0x0c or field_desc.type == 0x0d: # Memo or Blob - sub_block, block_start, blob_size = \ - struct.unpack_from(' 63: + if sub_block > 63: return u''; self.memo_file.seek(11 + (5 * sub_block), os.SEEK_CUR) sub_block_start, = struct.unpack('B', self.memo_file.read(1)) - self.memo_file.seek((block_start * 256) + - (sub_block_start * 16)) + self.memo_file.seek(block_start + (sub_block_start * 16)) else: return u''; return self.memo_file.read(blob_size)