Commit a81555ff authored by Valentin Vallaeys's avatar Valentin Vallaeys
Browse files

geoTiff: add fatal error if out of bound

parent 6fd5ca98
Pipeline #2433 failed with stages
in 31 minutes and 54 seconds
......@@ -122,6 +122,8 @@ double slimPreEvaluatorGeoTIFF::evaluate(double x, double y, double z) {
if(!GTIFPCSToImage(_gtif, &x, &y))
return 0;
if(x<0 || x>_sizex || y<0 || y>_sizey)
Msg::Fatal("error reading tiff file, out of boundary\n");
int x0 = std::min(_sizex-1,std::max(0, (int)floor(x)));
int x1 = std::min(_sizex-1,std::max(0, (int)ceil(x)));
int y0 = std::min(_sizey-1,std::max(0, (int)floor(y)));
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment