From f26672a38b4d71d1348515f3bd5ae15526f67288 Mon Sep 17 00:00:00 2001 From: Even Rouault Date: Tue, 28 Dec 2021 15:31:35 +0100 Subject: [PATCH] msProjectCreateReprojector() PROJ < 6 case: avoid potential crash in later calls (related to next commit) --- mapproject.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/mapproject.c b/mapproject.c index cd5bd15349..0a540727cb 100644 --- a/mapproject.c +++ b/mapproject.c @@ -559,6 +559,12 @@ reprojectionObj* msProjectCreateReprojector(projectionObj* in, projectionObj* ou { obj->no_op = MS_TRUE; } + else if( (in == NULL || in->proj == NULL) && + (out == NULL || out->proj == NULL) ) + { + msProjectDestroyReprojector(obj); + return NULL; + } return obj; }