Fix invalid read when using LightOccluder2D

This commit is contained in:
Haoyu Qiu 2022-01-17 16:02:26 +08:00
parent 8958e1b352
commit 7870cf24f2
1 changed files with 1 additions and 1 deletions

View File

@ -1440,7 +1440,7 @@ void RendererCanvasCull::canvas_light_occluder_set_polygon(RID p_occluder, RID p
ERR_FAIL_COND(!occluder);
if (occluder->polygon.is_valid()) {
LightOccluderPolygon *occluder_poly = canvas_light_occluder_polygon_owner.get_or_null(p_polygon);
LightOccluderPolygon *occluder_poly = canvas_light_occluder_polygon_owner.get_or_null(occluder->polygon);
if (occluder_poly) {
occluder_poly->owners.erase(occluder);
}