Skip to content

Commit 3d2af94

Browse files
Fix memory corruption when GEOMTRANSFORM and SHADOWCOLOR is used in label simultaneously #6114
1 parent 676691a commit 3d2af94

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

maplabel.c

+10
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,16 @@ void msCopyTextSymbol(textSymbolObj *dst, textSymbolObj *src) {
143143
dst->textpath = msSmallMalloc(sizeof(textPathObj));
144144
msCopyTextPath(dst->textpath,src->textpath);
145145
}
146+
if(dst->style_bounds) {
147+
int i;
148+
dst->style_bounds = msSmallCalloc(src->label->numstyles, sizeof(label_bounds*));
149+
for(i=0; i<src->label->numstyles; i++) {
150+
if(src->style_bounds[i]) {
151+
dst->style_bounds[i] = msSmallMalloc(sizeof(label_bounds));
152+
copyLabelBounds(dst->style_bounds[i], src->style_bounds[i]);
153+
}
154+
}
155+
}
146156
}
147157

148158
static int labelNeedsDeepCopy(labelObj *label) {

mapserver.h

+1
Original file line numberDiff line numberDiff line change
@@ -1843,6 +1843,7 @@ void msCopyTextPath(textPathObj *dst, textPathObj *src);
18431843
void freeTextPath(textPathObj *tp);
18441844
void initTextSymbol(textSymbolObj *ts);
18451845
void freeTextSymbol(textSymbolObj *ts);
1846+
void copyLabelBounds(label_bounds *dst, label_bounds *src);
18461847
void msCopyTextSymbol(textSymbolObj *dst, textSymbolObj *src);
18471848
void msPopulateTextSymbolForLabelAndString(textSymbolObj *ts, labelObj *l, char *string, double scalefactor, double resolutionfactor, label_cache_mode cache);
18481849
#endif /* SWIG */

0 commit comments

Comments
 (0)