From 9704e3eec5b8d01832c29293db76f68bb3a5ad4c Mon Sep 17 00:00:00 2001 From: Jiri Drbalek Date: Wed, 1 Jul 2015 12:12:21 +0000 Subject: [PATCH] fix integer overflow (-fsanitize=integer) --- test/visual/renderer.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/visual/renderer.hpp b/test/visual/renderer.hpp index f097dac2b..e66343ef9 100644 --- a/test/visual/renderer.hpp +++ b/test/visual/renderer.hpp @@ -125,7 +125,7 @@ struct svg_renderer : renderer_base } std::string expected(std::istreambuf_iterator(stream.rdbuf()),(std::istreambuf_iterator())); stream.close(); - return std::fabs(actual.size() - expected.size()); + return std::max(actual.size(), expected.size()) - std::min(actual.size(), expected.size()); } void save(image_type const & image, boost::filesystem::path const& path) const