diff options
author | Caolán McNamara <caolanm@redhat.com> | 2015-08-16 14:20:54 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2015-08-16 20:38:39 +0100 |
commit | 12143f8f84b07057d67d5cd6cc9ff6063dfa41f8 (patch) | |
tree | f88092be4fbe7f1119a2ffc83d60031c89d274c2 | |
parent | f3c7a3660ac36c5560419e60877f48939ba80ef7 (diff) |
clip Sttbf to available data
Change-Id: Iaa6a8a8505a28cf3c24a48f832bfc618b39c3f32
-rw-r--r-- | sw/qa/core/data/ww8/pass/crash-2.doc | bin | 0 -> 10240 bytes | |||
-rw-r--r-- | sw/source/filter/ww8/WW8Sttbf.cxx | 2 |
2 files changed, 2 insertions, 0 deletions
diff --git a/sw/qa/core/data/ww8/pass/crash-2.doc b/sw/qa/core/data/ww8/pass/crash-2.doc Binary files differnew file mode 100644 index 000000000000..452e21e511f1 --- /dev/null +++ b/sw/qa/core/data/ww8/pass/crash-2.doc diff --git a/sw/source/filter/ww8/WW8Sttbf.cxx b/sw/source/filter/ww8/WW8Sttbf.cxx index be6de9b7d3da..abb57bb82c40 100644 --- a/sw/source/filter/ww8/WW8Sttbf.cxx +++ b/sw/source/filter/ww8/WW8Sttbf.cxx @@ -32,6 +32,8 @@ namespace ww8 { if (checkSeek(rSt, nPos)) { + sal_Size nRemainingSize = rSt.remainingSize(); + nSize = std::min<sal_uInt32>(nRemainingSize, nSize); mp_data.reset(new sal_uInt8[nSize]); mn_size = rSt.Read(mp_data.get(), nSize); } |