Merge pull request #2944 from mapycz/fix-integer-overflow

fix integer overflow (-fsanitize=integer)
This commit is contained in:
Dane Springmeyer 2015-07-06 16:25:56 -07:00
commit aa2f769fdc

View file

@ -125,7 +125,7 @@ struct svg_renderer : renderer_base<std::string>
}
std::string expected(std::istreambuf_iterator<char>(stream.rdbuf()),(std::istreambuf_iterator<char>()));
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