summaryrefslogtreecommitdiff
path: root/sw/source/filter/ww8/ww8graf.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sw/source/filter/ww8/ww8graf.cxx')
-rw-r--r--sw/source/filter/ww8/ww8graf.cxx10
1 files changed, 8 insertions, 2 deletions
diff --git a/sw/source/filter/ww8/ww8graf.cxx b/sw/source/filter/ww8/ww8graf.cxx
index 8051810875a7..6a298878b807 100644
--- a/sw/source/filter/ww8/ww8graf.cxx
+++ b/sw/source/filter/ww8/ww8graf.cxx
@@ -1994,8 +1994,14 @@ void SwWW8ImplReader::MapWrapIntoFlyFmt(SvxMSDffImportRec* pRecord,
static sal_Int32 lcl_ConvertCrop(sal_uInt32 const nCrop, sal_Int32 const nSize)
{
// cast to sal_Int32 to handle negative crop properly
- return ((static_cast<sal_Int32>(nCrop) >> 16) * nSize)
- + (((nCrop & 0xffff) * nSize) >> 16) ;
+ sal_Int32 const nIntegral(static_cast<sal_Int32>(nCrop) >> 16);
+ // fdo#77454: heuristic to detect mangled values written by old OOo/LO
+ if (abs(nIntegral) >= 50) // FIXME: what's a good cut-off?
+ {
+ SAL_INFO("sw.ww8", "ignoring suspiciously large crop: " << nIntegral);
+ return 0;
+ }
+ return (nIntegral * nSize) + (((nCrop & 0xffff) * nSize) >> 16);
}
void