#5723 closed defect (invalid)
Overflow in Average Interpolation
Reported by: | johanstenberg | Owned by: | warmerdam |
---|---|---|---|
Priority: | low | Milestone: | |
Component: | Algorithms | Version: | svn-trunk |
Severity: | minor | Keywords: | |
Cc: |
Description
If you check this link:
https://github.com/OSGeo/gdal/blob/6c14b8248beee10e4993f9c866e05cf0ab3ee0d3/gdal/alg/gdalwarpkernel.cpp#L4567
I'm guessing this can yield an overflow.
Change History (7)
comment:1 by , 10 years ago
Resolution: | → invalid |
---|---|
Status: | new → closed |
comment:2 by , 10 years ago
Resolution: | invalid |
---|---|
Status: | closed → reopened |
comment:3 by , 10 years ago
Resolution: | → invalid |
---|---|
Status: | reopened → closed |
comment:4 by , 10 years ago
I don't really know the ins and outs of C++ but in Java for example, Double.MAX_VALUE + Double.MAX_VALUE leads to Double.Infinity. The same code in C++:
double d = numeric_limits<double>::max(); double c = d + d; cout << c << endl;
Leads to "inf" being printed. I just wanted to let you know.
comment:5 by , 10 years ago
My point here is that if you have a raster with all numeric_limits<double>::max() / 2, it will overflow and not yield the, computable, average.
comment:6 by , 10 years ago
ah I see. Hou have seen any such raster using the maximum double value or approachig values ? That would be a pain to deal with.
comment:7 by , 10 years ago
I don't have a raster, I was just reading through the source and thought about it. This algorithm fixes the issue: http://www.heikohoffmann.de/htmlthesis/node134.html.
I don't think so. This is a double variable.