Guard against undefined rectangle in BillboardTexture.loadImage#13487
Open
dannydjrs wants to merge 1 commit into
Open
Guard against undefined rectangle in BillboardTexture.loadImage#13487dannydjrs wants to merge 1 commit into
dannydjrs wants to merge 1 commit into
Conversation
Contributor
|
Thank you for the pull request, @dannydjrs! ✅ We can confirm we have a CLA on file for you. |
606ceee to
7a26e39
Compare
7a26e39 to
a2801a7
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
BillboardTexture.loadImagereadsatlas.rectangles[index].widthafterawaiting
TextureAtlas.addImage. In some interleavings — most reliablywhen the atlas resizes during the frame the image was queued — that slot
can still be
undefined, and the access escapes as an unhandled rejection:This shows up in apps that add/remove billboards rapidly (we hit it
through ol-cesium's
FeatureConverter.csAddBillboardon a timer-drivenre-render loop).
This change guards the rectangle access and, when it's missing, marks the
texture as
FAILED— matching the existing pattern in the same methodfor
!defined(index) || index === -1.Issue number and link
#13486
Testing plan
Added a regression spec covering the case where
TextureAtlas.addImageresolves with an index whose rectangle is undefined. The spec asserts the
texture transitions to
BillboardLoadState.FAILEDandloadImagedoesnot reject.
Author checklist
CONTRIBUTORS.mdCHANGES.mdwith a short summary of my changeAI acknowledgment
If yes, I used the following Tools(s) and/or Service(s):
If yes, I used the following Model(s):