You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to draw a map with a grid layer that has no labels.
If I put in an empty label block, the map works with the label defaults for font, size, color, etc. But, if I comment out the label block, I get a crash. The grid with no label block works with MapServer 7.0.4 , but not MapServer 7.0.6, branch-7.0, or master.
I've attached a test mapfile, and the GDB output I got with a build from master.
To clarify, the way we are using the grid is to get the intersections and labels from msGraticuleLayerGetIntersectionPoints to insert labels into a PDF around the map, so that's why I have a LABELFORMAT, but no LABEL block in my example. We don't want labels on the map, we place them around the map with custom code that formats them as we want and inserts the map into an SVG.
I believe leaving the LABELFORMAT out would result in not getting appropriate grid values from msGraticuleLayerGetIntersectionPoints. See attached images.
valgrind ./shp2img -m grid.map -o out.png
==23204== Memcheck, a memory error detector
==23204== Copyright (C) 2002-2015, and GNU GPL'd, by Julian Seward et al.
==23204== Using Valgrind-3.11.0 and LibVEX; rerun with -h for copyright info
==23204== Command: ./shp2img -m grid.map -o out.png
==23204== Conditional jump or move depends on uninitialised value(s)
==23204== at 0x4C2EDA1: free (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==23204== by 0x4F5CD8F: msFreeShape (mapprimitive.c:160)
==23204== by 0x4EF1004: msGraticuleLayerNextShape (mapgraticule.c:302)
==23204== by 0x4F69409: msLayerNextShape (maplayer.c:337)
==23204== by 0x4F9D07B: msDrawVectorLayer (mapdraw.c:1094)
==23204== by 0x4F9B92C: msDrawLayer (mapdraw.c:811)
==23204== by 0x4F9A2CC: msDrawMap (mapdraw.c:388)
==23204== by 0x40248B: main (shp2img.c:296)
I've just committed a fix. Appears it is indeed a regression due to changes I done in that area. I have added a test case that triggers this situation so we don't regress on that anymore