aboutsummaryrefslogtreecommitdiff
path: root/src/projections/isea.cpp
diff options
context:
space:
mode:
authorEven Rouault <even.rouault@spatialys.com>2019-04-18 22:12:55 +0200
committerEven Rouault <even.rouault@spatialys.com>2019-04-18 22:12:55 +0200
commit4c8a5cb8c7f69dd227f03f32eb99b53ea0586aba (patch)
treece51488f47e972692a24ed2b08ec74e6261b6b46 /src/projections/isea.cpp
parentcf0a6384741354811f821f1cc63bb7f2b69b9924 (diff)
downloadPROJ-4c8a5cb8c7f69dd227f03f32eb99b53ea0586aba.tar.gz
PROJ-4c8a5cb8c7f69dd227f03f32eb99b53ea0586aba.zip
isea: avoid invalid integer shift
Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=14286 Credit to OSS Fuzz
Diffstat (limited to 'src/projections/isea.cpp')
-rw-r--r--src/projections/isea.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/projections/isea.cpp b/src/projections/isea.cpp
index 28510cb0..e8720b27 100644
--- a/src/projections/isea.cpp
+++ b/src/projections/isea.cpp
@@ -898,6 +898,10 @@ static int isea_hex(struct isea_dgg *g, int tri,
quad = isea_ptdi(g, tri, pt, &v);
+ if( v.x < (INT_MIN >> 4) || v.x > (INT_MAX >> 4) )
+ {
+ throw "Invalid shift";
+ }
hex->x = ((int)v.x << 4) + quad;
hex->y = v.y;