[MapServer-dev] Zero-size SVG rendering : mapserv.fcgi crashes

Philippe Ghesquiere philippe.ghesquiere at airbus.com
Fri Nov 10 07:40:50 PST 2023


Hi all,

My mapserver installation is based on :

   - Mapserver 7.6.3
   - MapCache : 1.12.0

I bumped into a configuration (zoom, orientation, ...) where an SVG symbol
has one null dimension (height or width).
The rendering process crashes with the following error message (mapcairo.c
<https://github.com/MapServer/MapServer/blob/rel-7-6-3/mapcairo.c>) :
mapserv.fcgi: /builds/i4d/datacenter/mapserver/MapServer/mapcairo.c:1074:
msRenderRasterizedSVGSymbol: Assertion `svg_cache->pixmap_buffer->height &&
svg_cache->pixmap_buffer->width' failed.

The code snippet  shows :
//already rendered at the right size and scale? return
if(svg_cache->scale != style->scale || svg_cache->rotation !=
style->rotation) {
...
}
assert(svg_cache->pixmap_buffer->height && svg_cache->pixmap_buffer->width);

Instead of crashing the rendering process, wouldn't it be more appropriate
to test buffer dimensions beforehands.
Something like :
if ( (svg_cache->pixmap_buffer->height == 0 ||
(svg_cache->pixmap_buffer->width == 0) )
   return MS_FAILURE;

//already rendered at the right size and scale? return
if(svg_cache->scale != style->scale || svg_cache->rotation !=
style->rotation) {
...
}

Philippe
The information in this e-mail is confidential. The contents may not be disclosed or used by anyone other than the addressee. Access to this e-mail by anyone else is unauthorised.
If you are not the intended recipient, please notify Airbus immediately and delete this e-mail.
Airbus cannot accept any responsibility for the accuracy or completeness of this e-mail as it has been sent over public networks. If you have any concerns over the content of this message or its Accuracy or Integrity, please contact Airbus immediately.
All outgoing e-mails from Airbus are checked using regularly updated virus scanning software but you should take whatever measures you deem to be appropriate to ensure that this message and any attachments are virus free.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-dev/attachments/20231110/4383d910/attachment-0001.htm>


More information about the MapServer-dev mailing list