diff --git a/src/calibre/ebooks/odt/input.py b/src/calibre/ebooks/odt/input.py index 438e0336b7..cc8073ee37 100644 --- a/src/calibre/ebooks/odt/input.py +++ b/src/calibre/ebooks/odt/input.py @@ -34,7 +34,7 @@ class Extract(ODF2XHTML): for name in zf.namelist(): if name.startswith('Pictures') and name not in {'Pictures', 'Pictures/'}: dest = os.path.abspath(os.path.join(base, name)) - if os.path.commonprefix([base, dest]) != dest: + if os.path.commonprefix([base, dest]) != base: continue data = zf.read(name) with open(dest, 'wb') as f: