From 4c8a5cb8c7f69dd227f03f32eb99b53ea0586aba Mon Sep 17 00:00:00 2001 From: Even Rouault Date: Thu, 18 Apr 2019 22:12:55 +0200 Subject: isea: avoid invalid integer shift Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=14286 Credit to OSS Fuzz --- src/projections/isea.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/projections/isea.cpp') 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; -- cgit v1.2.3