[mapserver-commits] [MapServer/MapServer] 036832: mapobject.c: clear cached reprojectors in msRemove...

github-actions[bot] noreply at github.com
Fri Aug 28 04:21:11 PDT 2026


  Branch: refs/heads/branch-8-6
  Home:   https://github.com/MapServer/MapServer
  Commit: 036832880af49e1243650306d524cb3b533f4dee
      https://github.com/MapServer/MapServer/commit/036832880af49e1243650306d524cb3b533f4dee
  Author: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
  Date:   2026-08-28 (Fri, 28 Aug 2026)

  Changed paths:
    M msautotest/mspython/test_bug_check.py
    M src/mapobject.c

  Log Message:
  -----------
  mapobject.c: clear cached reprojectors in msRemoveLayer() (fixes #7611) (#7618)

msRemoveLayer() detached a layer without clearing
layer->reprojectorLayerToMap / reprojectorMapToLayer. Those cached
reprojectors hold a raw pointer to the map the layer was removed from,
which has two consequences:

- A layer moved to another map keeps reprojecting to the old map's
  projection, so it is drawn in the wrong place or not at all.
- If the old map is freed while the layer lives on, the next
  msLayerGetReprojectorToMap() reads reprojector->out->generation_number
  from freed memory.

freeLayer() already destroys both cached reprojectors and initLayer()
initialises them to NULL, so this brings msRemoveLayer() in line with the
other two.

Adds a msautotest case that moves a layer between two maps with different
projections and checks that it still renders in the new one.

Co-authored-by: MarkLee131 <kaixuan.li at ntu.edu.sg>



To unsubscribe from these emails, change your notification settings at https://github.com/MapServer/MapServer/settings/notifications


More information about the MapServer-commits mailing list