fix: handle a textools bug explicitly
This commit is contained in:
parent
17d28d3774
commit
95c90ef66e
|
@ -16,4 +16,6 @@ pub enum Error {
|
||||||
SqPackError(#[from] sqpack::binrw::Error),
|
SqPackError(#[from] sqpack::binrw::Error),
|
||||||
#[error("error writing to output")]
|
#[error("error writing to output")]
|
||||||
BinRwWrite(sqpack::binrw::Error),
|
BinRwWrite(sqpack::binrw::Error),
|
||||||
|
#[error("a bug in textools corrupted this mod pack")]
|
||||||
|
TexToolsBug,
|
||||||
}
|
}
|
||||||
|
|
|
@ -347,6 +347,9 @@ impl<R: Read> TtmpExtractor<R> {
|
||||||
let mut reader = (&mut reader).take(header.uncompressed_size as u64);
|
let mut reader = (&mut reader).take(header.uncompressed_size as u64);
|
||||||
let read = std::io::copy(&mut reader, &mut writer).map_err(Error::Io)?;
|
let read = std::io::copy(&mut reader, &mut writer).map_err(Error::Io)?;
|
||||||
(read, read)
|
(read, read)
|
||||||
|
} else if header.compressed_size == 0 {
|
||||||
|
// https://github.com/TexTools/xivModdingFramework/issues/51
|
||||||
|
return Err(Error::TexToolsBug);
|
||||||
} else {
|
} else {
|
||||||
// compressed
|
// compressed
|
||||||
let reader = (&mut reader).take(header.compressed_size as u64);
|
let reader = (&mut reader).take(header.compressed_size as u64);
|
||||||
|
|
Loading…
Reference in New Issue