diff options
author | Caolán McNamara <caolanm@redhat.com> | 2017-03-14 10:26:35 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2017-03-14 10:26:57 +0000 |
commit | b36c2961b279c8e8b96b1c6d9682e59eeac3854a (patch) | |
tree | 29b0f994a94ec06ecfae07acc9663f02392afe96 /vcl/source/gdi | |
parent | 986ab0b771e8e921d132059fda4971b18064c1aa (diff) |
ofz: reject invalid mapmodes early
Change-Id: I7fae0eb980b6dc655254da8b401fc1e71a4e65cf
Diffstat (limited to 'vcl/source/gdi')
-rw-r--r-- | vcl/source/gdi/svmconverter.cxx | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/vcl/source/gdi/svmconverter.cxx b/vcl/source/gdi/svmconverter.cxx index 2cadb221247b..1b2a8a8adda5 100644 --- a/vcl/source/gdi/svmconverter.cxx +++ b/vcl/source/gdi/svmconverter.cxx @@ -165,6 +165,12 @@ bool ImplReadMapMode(SvStream& rIStm, MapMode& rMapMode) return false; } + if (nUnit < sal_Int16(MapUnit::Map100thMM) || nUnit > sal_Int16(MapUnit::LAST)) + { + SAL_WARN("vcl.gdi", "Parsing error: invalid mapmode"); + return false; + } + rMapMode = MapMode( (MapUnit) nUnit, aOrg, Fraction( nXNum, nXDenom ), Fraction( nYNum, nYDenom ) ); return true; |