Skip to content

Commit

Permalink
fix segfault on UVRASTER layers with mask set (#4779)
Browse files Browse the repository at this point in the history
  • Loading branch information
tbonfort committed Oct 4, 2013
1 parent edae73d commit 942e1d7
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion mapuvraster.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

/*
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 942e1d7

Please sign in to comment.