fix: work around textools bug by zero-filling
This commit is contained in:
parent
fdf53e14d1
commit
065b6cc8e2
|
@ -16,6 +16,4 @@ pub enum Error {
|
|||
SqPackError(#[from] sqpack::binrw::Error),
|
||||
#[error("error writing to output")]
|
||||
BinRwWrite(sqpack::binrw::Error),
|
||||
#[error("a bug in textools corrupted this mod pack")]
|
||||
TexToolsBug,
|
||||
}
|
||||
|
|
|
@ -349,7 +349,11 @@ impl<R: Read> TtmpExtractor<R> {
|
|||
(read, read)
|
||||
} else if header.compressed_size == 0 {
|
||||
// https://github.com/TexTools/xivModdingFramework/issues/51
|
||||
return Err(Error::TexToolsBug);
|
||||
let zeroes: Vec<u8> = std::iter::repeat(0)
|
||||
.take(header.uncompressed_size as usize)
|
||||
.collect();
|
||||
std::io::copy(&mut Cursor::new(zeroes), &mut writer).map_err(Error::Io)?;
|
||||
(0, 0)
|
||||
} else {
|
||||
// compressed
|
||||
let reader = (&mut reader).take(header.compressed_size as u64);
|
||||
|
|
Loading…
Reference in New Issue