Permalink
Browse files

fix segfault on UVRASTER layers with mask set (#4779)

  • Loading branch information...
1 parent edae73d commit 942e1d721fcfbde75a516abf61efcbf737bde827 @tbonfort tbonfort committed Oct 4, 2013
Showing with 11 additions and 1 deletion.
  1. +11 −1 mapuvraster.c
View
@@ -338,7 +338,7 @@ int msUVRASTERLayerWhichShapes(layerObj *layer, rectObj rect, int isQuery)
double map_cellsize;
unsigned int spacing;
int width, height, u_src_off, v_src_off, i, x, y;
- char **alteredProcessing = NULL;
+ char **alteredProcessing = NULL, *saved_layer_mask;
char **savedProcessing = NULL;
/*
@@ -446,11 +446,21 @@ int msUVRASTERLayerWhichShapes(layerObj *layer, rectObj rect, int isQuery)
layer->processing = alteredProcessing;
}
+ /* disable masking at this level: we don't want to apply the mask at the raster level,
+ * it will be applied with the correct cellsize and image size in the vector rendering
+ * phase.
+ */
+ saved_layer_mask = layer->mask;
+ layer->mask = NULL;
if (msDrawRasterLayerLow(map_tmp, layer, image_tmp, NULL ) == MS_FAILURE) {
msSetError(MS_MISCERR, "Unable to draw raster data.", "msUVRASTERLayerWhichShapes()");
+ layer->mask = saved_layer_mask;
return MS_FAILURE;
}
+ /* restore layer mask */
+ layer->mask = saved_layer_mask;
+
/* restore the saved processing */
if (alteredProcessing != NULL) {
layer->processing = savedProcessing;

0 comments on commit 942e1d7

Please sign in to comment.