Fix invalid read when using LightOccluder2D

(cherry picked from commit 7870cf24f2)
This commit is contained in:
Haoyu Qiu 2022-01-17 16:02:26 +08:00 committed by Rémi Verschelde
parent 987c43f060
commit 9e7bf8fa73
No known key found for this signature in database
GPG Key ID: C3336907360768E1

View File

@ -1141,7 +1141,7 @@ void VisualServerCanvas::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(p_polygon);
LightOccluderPolygon *occluder_poly = canvas_light_occluder_polygon_owner.get(occluder->polygon);
if (occluder_poly) {
occluder_poly->owners.erase(occluder);
}