Skip to content

Commit c217944

Browse files
committed
Fix crash on legend icon with offset generation (#4790)
1 parent 40b975b commit c217944

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

maplegend.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@ int msDrawLegendIcon(mapObj *map, layerObj *lp, classObj *theclass,
119119
}
120120

121121
/* initialize the box used for polygons and for outlines */
122+
msInitShape(&box);
122123
box.line = (lineObj *)msSmallMalloc(sizeof(lineObj));
123124
box.numlines = 1;
124125
box.line[0].point = (pointObj *)msSmallMalloc(sizeof(pointObj)*5);
@@ -244,6 +245,7 @@ int msDrawLegendIcon(mapObj *map, layerObj *lp, classObj *theclass,
244245
else
245246
offset = theclass->styles[0]->width/2;
246247
}
248+
msInitShape(&zigzag);
247249
zigzag.line = (lineObj *)msSmallMalloc(sizeof(lineObj));
248250
zigzag.numlines = 1;
249251
zigzag.line[0].point = (pointObj *)msSmallMalloc(sizeof(pointObj)*4);

0 commit comments

Comments
 (0)