From 4b6fc5f72099b0319241c88a4119105f7d8e015f Mon Sep 17 00:00:00 2001 From: Capostrophic Date: Sat, 30 Mar 2019 20:09:30 +0300 Subject: [PATCH] Make sure the record hasn't ended in getHString hack (bug #4938) --- CHANGELOG.md | 1 + components/esm/esmreader.cpp | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index deb5c88d1..3e13cc363 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -48,6 +48,7 @@ Bug #4911: Editor: QOpenGLContext::swapBuffers() warning with Qt5 Bug #4916: Specular power (shininess) material parameter is ignored when shaders are used. Bug #4922: Werewolves can not attack if the transformation happens during attack + Bug #4938: Strings from subrecords with actually empty headers can't be empty Feature #2229: Improve pathfinding AI Feature #3442: Default values for fallbacks from ini file Feature #3610: Option to invert X axis diff --git a/components/esm/esmreader.cpp b/components/esm/esmreader.cpp index 2f4f4917c..278a1541a 100644 --- a/components/esm/esmreader.cpp +++ b/components/esm/esmreader.cpp @@ -127,7 +127,7 @@ std::string ESMReader::getHString() // them. For some reason, they break the rules, and contain a byte // (value 0) even if the header says there is no data. If // Morrowind accepts it, so should we. - if (mCtx.leftSub == 0) + if (mCtx.leftSub == 0 && mCtx.leftRec != 0) { // Skip the following zero byte mCtx.leftRec--;