mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix #1279: correctly decrement remaining bytes while reading LIT directory chunks.
This commit is contained in:
parent
e6d872c317
commit
9cc7a6e0b3
@ -557,7 +557,9 @@ class LitReader(object):
|
||||
if namelen > remaining - 3:
|
||||
raise LitError('Read past end of directory chunk')
|
||||
try:
|
||||
name, chunk = chunk[:namelen].decode('utf-8'), chunk[namelen:]
|
||||
name = chunk[:namelen].decode('utf-8')
|
||||
chunk = chunk[namelen:]
|
||||
remaining -= namelen
|
||||
except UnicodeDecodeError:
|
||||
break
|
||||
section, chunk, remaining = encint(chunk, remaining)
|
||||
|
Loading…
x
Reference in New Issue
Block a user