diff options
author | Caolán McNamara <caolanm@redhat.com> | 2015-11-24 15:06:32 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2015-11-24 15:19:02 +0000 |
commit | 7acbf173fc9f624da144a242e33033de56550a2f (patch) | |
tree | 4c82cf2264fed679e18596181e814d998b8926cc /xmloff | |
parent | 78407eea3ddb5717a501d9336e3b3cbef188d010 (diff) |
crashtesting: ooo72999-1.ods NaNs found in light direction
and NaN != NaN so busted logic propogates, drop invalid directions
on initial read
Change-Id: Ic76c714666df14d37a4c68f43b817327675bd0e0
Diffstat (limited to 'xmloff')
-rw-r--r-- | xmloff/source/draw/ximp3dscene.cxx | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/xmloff/source/draw/ximp3dscene.cxx b/xmloff/source/draw/ximp3dscene.cxx index 5fc4b451b197..83c20330bfb1 100644 --- a/xmloff/source/draw/ximp3dscene.cxx +++ b/xmloff/source/draw/ximp3dscene.cxx @@ -64,7 +64,16 @@ SdXML3DLightContext::SdXML3DLightContext( } case XML_TOK_3DLIGHT_DIRECTION: { - SvXMLUnitConverter::convertB3DVector(maDirection, sValue); + ::basegfx::B3DVector aVal; + SvXMLUnitConverter::convertB3DVector(aVal, sValue); + if (!isnan(aVal.getX()) && !isnan(aVal.getY()) && !isnan(aVal.getZ())) + { + maDirection = aVal; + } + else + { + SAL_WARN("xmloff", "NaNs found in light direction: " << sValue); + } break; } case XML_TOK_3DLIGHT_ENABLED: |