Skip to content

Commit ddbcb06

Browse files
committed
Issue #252: fix SIGSEGV on <symlink_blank> without <format>
1 parent 11f7713 commit ddbcb06

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

lib/cache_disk.c

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -533,12 +533,18 @@ static void _mapcache_cache_disk_set(mapcache_context *ctx, mapcache_cache *pcac
533533
}
534534

535535
#ifdef HAVE_SYMLINK
536-
if(cache->symlink_blank) {
537-
if(tile->tileset->format->type != GC_RAW && !tile->raw_image) {
536+
if ( cache->symlink_blank
537+
&& (!tile->tileset->format || tile->tileset->format->type != GC_RAW) )
538+
{
539+
// <symlink_blank> is handled when tileset's format, if set, is not RAW
540+
541+
if (!tile->raw_image)
542+
{
538543
tile->raw_image = mapcache_imageio_decode(ctx, tile->encoded_data);
539544
GC_CHECK_ERROR(ctx);
540545
}
541-
if(tile->tileset->format->type != GC_RAW && mapcache_image_blank_color(tile->raw_image) != MAPCACHE_FALSE) {
546+
if (mapcache_image_blank_color(tile->raw_image) != MAPCACHE_FALSE)
547+
{
542548
char *blankname;
543549
int retry_count_create_symlink = 0;
544550
char *blankname_rel = NULL;

0 commit comments

Comments
 (0)