From 436f24add5ee0683cdafb0cea9008575cbef04e2 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Fri, 12 Jan 2024 00:30:56 +0100 Subject: [PATCH] disable the buffering file reader. This was definitely crashing on Death Wish's E1 movie and probably caused other problems as well. --- libraries/ZWidget/src/core/widget.cpp | 2 +- source/common/filesystem/source/files_decompress.cpp | 2 +- source/common/filesystem/source/filesystem.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/libraries/ZWidget/src/core/widget.cpp b/libraries/ZWidget/src/core/widget.cpp index 7ddc1ca59..93a41fbc7 100644 --- a/libraries/ZWidget/src/core/widget.cpp +++ b/libraries/ZWidget/src/core/widget.cpp @@ -564,7 +564,7 @@ void Widget::OnWindowMouseMove(const Point& pos) { widget->OnMouseMove(widget->MapFrom(this, pos)); widget = widget->Parent(); - } while (widget != this); + } while (widget != this && widget != nullptr); } } diff --git a/source/common/filesystem/source/files_decompress.cpp b/source/common/filesystem/source/files_decompress.cpp index 95cce3c33..9d00ee6df 100644 --- a/source/common/filesystem/source/files_decompress.cpp +++ b/source/common/filesystem/source/files_decompress.cpp @@ -980,7 +980,7 @@ bool OpenDecompressor(FileReader& self, FileReader &parent, FileReader::Size len } dec->Length = length; } - if ((flags & DCF_CACHED)) + if ((flags & (DCF_CACHED| DCF_SEEKABLE))) // the buffering reader does not seem to be stable, so cache it instead until we find out what's wrong. { // read everything into a MemoryArrayReader. FileData data(nullptr, length); diff --git a/source/common/filesystem/source/filesystem.cpp b/source/common/filesystem/source/filesystem.cpp index a8418956f..fee5f1011 100644 --- a/source/common/filesystem/source/filesystem.cpp +++ b/source/common/filesystem/source/filesystem.cpp @@ -395,7 +395,7 @@ void FileSystem::AddFile (const char *filename, FileReader *filer, LumpFilterInf std::string path = filename; path += ':'; path += resfile->getName(i); - auto embedded = resfile->GetEntryReader(i, READER_NEW, READERFLAG_SEEKABLE); + auto embedded = resfile->GetEntryReader(i, READER_CACHED); AddFile(path.c_str(), &embedded, filter, Printf, hashfile); } }