diff --git a/layout/base/FrameLayerBuilder.cpp b/layout/base/FrameLayerBuilder.cpp index bf3326182c6f..045f4a0ace03 100644 --- a/layout/base/FrameLayerBuilder.cpp +++ b/layout/base/FrameLayerBuilder.cpp @@ -3762,7 +3762,7 @@ GetScrollClipIntersection(nsDisplayListBuilder* aBuilder, AnimatedGeometryRoot* DisplayItemClip resultClip; nsIFrame* fParent; for (AnimatedGeometryRoot* agr = aAnimatedGeometryRoot; - agr != aStopAtAnimatedGeometryRoot; + agr != aStopAtAnimatedGeometryRoot && agr; agr = agr->mParentAGR) { fParent = nsLayoutUtils::GetCrossDocParentFrame(*agr); if (!fParent) {