changeset 29844:ceb2259f7c11

maint: Merge stable to default.
author Markus Mützel <markus.muetzel@gmx.de>
date Thu, 01 Jul 2021 15:28:17 +0200
parents 9ede1179a1ee (current diff) c4f9513b09f1 (diff)
children 2ef9080ca017
files libinterp/corefcn/ls-mat5.cc
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/libinterp/corefcn/ls-mat5.cc	Wed Jun 30 12:43:01 2021 -0400
+++ b/libinterp/corefcn/ls-mat5.cc	Thu Jul 01 15:28:17 2021 +0200
@@ -2395,7 +2395,7 @@
           // + 12 bytes.  Reality is it must be larger again than that.
           std::string buf_str = buf.str ();
           uLongf srcLen = buf_str.length ();
-          uLongf destLen = srcLen * 101 / 100 + 12;
+          uLongf destLen = compressBound (srcLen);
           OCTAVE_LOCAL_BUFFER (char, out_buf, destLen);
 
           if (compress (reinterpret_cast<Bytef *> (out_buf), &destLen,