Commit 0e22e5f
authored
Initialize _clippedViewPort to avoid null deref on first render (#1148)
_clippedViewPort is declared but never initialized, unlike its sibling
_previousViewPort. It is only assigned inside updateClippedViewPort(),
which updateViewPort() skips calling whenever _viewPort already equals
the default-empty _previousViewPort — which can be true on the very
first frame depending on how the initial viewport is set up. When that
happens, render() dereferences _clippedViewPort.width/height while it
is still null.
Found while porting a unit test suite to openfl/starling (the Haxe
port carries the identical gap), and confirmed here in the original
AS3 source.1 parent 94e73d3 commit 0e22e5f
1 file changed
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
280 | 280 | | |
281 | 281 | | |
282 | 282 | | |
| 283 | + | |
283 | 284 | | |
284 | 285 | | |
285 | 286 | | |
| |||
0 commit comments