Backup: Stable state with EPUB reader fixes (Freeze, OOM, Speed, State, Tooling)
This commit is contained in:
@@ -39,14 +39,26 @@ static void writeString(FsFile& file, const std::string& s) {
|
||||
static void readString(std::istream& is, std::string& s) {
|
||||
uint32_t len;
|
||||
readPod(is, len);
|
||||
if (len > 4096) {
|
||||
s = "";
|
||||
return;
|
||||
}
|
||||
s.resize(len);
|
||||
is.read(&s[0], len);
|
||||
if (len > 0) {
|
||||
is.read(&s[0], len);
|
||||
}
|
||||
}
|
||||
|
||||
static void readString(FsFile& file, std::string& s) {
|
||||
uint32_t len;
|
||||
readPod(file, len);
|
||||
if (len > 4096) {
|
||||
s = "";
|
||||
return;
|
||||
}
|
||||
s.resize(len);
|
||||
file.read(&s[0], len);
|
||||
if (len > 0) {
|
||||
file.read(&s[0], len);
|
||||
}
|
||||
}
|
||||
} // namespace serialization
|
||||
|
||||
Reference in New Issue
Block a user