[Libreoffice-commits] core.git: vcl/qa vcl/source
Caolán McNamara
caolanm at redhat.com
Thu Mar 23 16:39:03 UTC 2017
vcl/qa/cppunit/graphicfilter/data/svm/fail/mapmode-4.svm |binary
vcl/qa/cppunit/graphicfilter/data/svm/fail/mapmode-5.svm |binary
vcl/qa/cppunit/graphicfilter/data/svm/fail/mapmode-6.svm |binary
vcl/qa/cppunit/graphicfilter/data/svm/pass/leak-1.svm |binary
vcl/qa/cppunit/graphicfilter/data/svm/pass/mapmode-1.svm |binary
vcl/qa/cppunit/graphicfilter/data/svm/pass/mapmode-2.svm |binary
vcl/qa/cppunit/graphicfilter/data/svm/pass/mapmode-3.svm |binary
vcl/qa/cppunit/graphicfilter/filters-test.cxx | 3 ++
vcl/source/gdi/svmconverter.cxx | 16 ---------------
9 files changed, 4 insertions(+), 15 deletions(-)
New commits:
commit d57f707bbd4ca19f5c1112383f533615a7c7e8a2
Author: Caolán McNamara <caolanm at redhat.com>
Date: Thu Mar 23 14:53:30 2017 +0000
add svm cppunit test
and rely on new safe multiple check of
commit 4f0b226600fdad4e5aef9313fe8754c765cfee42
Author: Caolán McNamara <caolanm at redhat.com>
Date: Tue Mar 21 11:23:09 2017 +0000
check for overflow in multiply
rather than trying to detect them here in advance
Change-Id: I7fb9a9960e428cf00f745b6156a588e2c990c03f
Reviewed-on: https://gerrit.libreoffice.org/35595
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
Tested-by: Caolán McNamara <caolanm at redhat.com>
diff --git a/vcl/qa/cppunit/graphicfilter/data/svm/fail/.gitignore b/vcl/qa/cppunit/graphicfilter/data/svm/fail/.gitignore
new file mode 100644
index 000000000000..e69de29bb2d1
diff --git a/vcl/qa/cppunit/graphicfilter/data/svm/fail/mapmode-4.svm b/vcl/qa/cppunit/graphicfilter/data/svm/fail/mapmode-4.svm
new file mode 100644
index 000000000000..c2f14d4a0e0b
Binary files /dev/null and b/vcl/qa/cppunit/graphicfilter/data/svm/fail/mapmode-4.svm differ
diff --git a/vcl/qa/cppunit/graphicfilter/data/svm/fail/mapmode-5.svm b/vcl/qa/cppunit/graphicfilter/data/svm/fail/mapmode-5.svm
new file mode 100644
index 000000000000..835e7f66839e
Binary files /dev/null and b/vcl/qa/cppunit/graphicfilter/data/svm/fail/mapmode-5.svm differ
diff --git a/vcl/qa/cppunit/graphicfilter/data/svm/fail/mapmode-6.svm b/vcl/qa/cppunit/graphicfilter/data/svm/fail/mapmode-6.svm
new file mode 100644
index 000000000000..8e8439315bcd
Binary files /dev/null and b/vcl/qa/cppunit/graphicfilter/data/svm/fail/mapmode-6.svm differ
diff --git a/vcl/qa/cppunit/graphicfilter/data/svm/indeterminate/.gitignore b/vcl/qa/cppunit/graphicfilter/data/svm/indeterminate/.gitignore
new file mode 100644
index 000000000000..e69de29bb2d1
diff --git a/vcl/qa/cppunit/graphicfilter/data/svm/pass/.gitignore b/vcl/qa/cppunit/graphicfilter/data/svm/pass/.gitignore
new file mode 100644
index 000000000000..e69de29bb2d1
diff --git a/vcl/qa/cppunit/graphicfilter/data/svm/pass/leak-1.svm b/vcl/qa/cppunit/graphicfilter/data/svm/pass/leak-1.svm
new file mode 100644
index 000000000000..14dbea080936
Binary files /dev/null and b/vcl/qa/cppunit/graphicfilter/data/svm/pass/leak-1.svm differ
diff --git a/vcl/qa/cppunit/graphicfilter/data/svm/pass/mapmode-1.svm b/vcl/qa/cppunit/graphicfilter/data/svm/pass/mapmode-1.svm
new file mode 100644
index 000000000000..2fce465f7653
Binary files /dev/null and b/vcl/qa/cppunit/graphicfilter/data/svm/pass/mapmode-1.svm differ
diff --git a/vcl/qa/cppunit/graphicfilter/data/svm/pass/mapmode-2.svm b/vcl/qa/cppunit/graphicfilter/data/svm/pass/mapmode-2.svm
new file mode 100644
index 000000000000..1b3cd14167cf
Binary files /dev/null and b/vcl/qa/cppunit/graphicfilter/data/svm/pass/mapmode-2.svm differ
diff --git a/vcl/qa/cppunit/graphicfilter/data/svm/pass/mapmode-3.svm b/vcl/qa/cppunit/graphicfilter/data/svm/pass/mapmode-3.svm
new file mode 100644
index 000000000000..b4afeb09f2d8
Binary files /dev/null and b/vcl/qa/cppunit/graphicfilter/data/svm/pass/mapmode-3.svm differ
diff --git a/vcl/qa/cppunit/graphicfilter/filters-test.cxx b/vcl/qa/cppunit/graphicfilter/filters-test.cxx
index ab615330005e..6c0eedffb1f7 100644
--- a/vcl/qa/cppunit/graphicfilter/filters-test.cxx
+++ b/vcl/qa/cppunit/graphicfilter/filters-test.cxx
@@ -148,6 +148,9 @@ void VclFiltersTest::testCVEs()
testDir(OUString(),
m_directories.getURLFromSrc("/vcl/qa/cppunit/graphicfilter/data/xpm/"));
+
+ testDir(OUString(),
+ m_directories.getURLFromSrc("/vcl/qa/cppunit/graphicfilter/data/svm/"));
#endif
}
diff --git a/vcl/source/gdi/svmconverter.cxx b/vcl/source/gdi/svmconverter.cxx
index 89e42dd0f94c..ea4485828081 100644
--- a/vcl/source/gdi/svmconverter.cxx
+++ b/vcl/source/gdi/svmconverter.cxx
@@ -171,21 +171,7 @@ bool ImplReadMapMode(SvStream& rIStm, MapMode& rMapMode)
return false;
}
- Fraction aX(nXNum, nXDenom);
- if (!aX.IsValid() || rtl::math::round(aX, 6) == 0.0)
- {
- SAL_WARN("vcl.gdi", "Parsing error: invalid mapmode fraction");
- return false;
- }
-
- Fraction aY(nYNum, nYDenom);
- if (!aY.IsValid() || rtl::math::round(aY, 6) == 0.0)
- {
- SAL_WARN("vcl.gdi", "Parsing error: invalid mapmode fraction");
- return false;
- }
-
- rMapMode = MapMode((MapUnit) nUnit, aOrg, aX, aY);
+ rMapMode = MapMode((MapUnit) nUnit, aOrg, Fraction(nXNum, nXDenom), Fraction(nYNum, nYDenom));
return true;
}
More information about the Libreoffice-commits
mailing list