Repository navigation
[Decode] Keep JPEG slice buffer state consistent across errors - #2090
Draft
XinfengZhang wants to merge 1 commit into
Draft
XinfengZhang wants to merge 1 commit into
XinfengZhang wants to merge 1 commit into
Conversation
Preserve live JPEG slice slots when another buffer is destroyed and invalidate render-order entries for released buffers. Fully initialize new slots and reset picture tracking on BeginPicture and every SetDecodeParams return. Validate the rendered buffers and accumulated size before allocation, then check copies against the actual remaining bitstream capacity. Release any previous legacy bitstream buffer before replacing it during an error retry.
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.
JPEG slice-buffer bookkeeping can retain rendered flags after a failed picture
and overwrite a live slot when a lower-index buffer is destroyed. This can make
the tracked bitstream size smaller than the data copied into the destination.
Preserve live slot indices, invalidate render-order references on destruction,
initialize new slots completely, and reset rendered state across picture errors.
Validate rendered buffers and total size before allocation, check copies against
the actual remaining destination capacity, and release the previous legacy
bitstream buffer before replacing it during a retry.
Validation: extracted production functions from both decoder paths passed 200
state-transition sequences each under ASan and UBSan, including destruction,
slot reuse, allocation/mapping/copy failures, retries, and valid recovery. The
tests use CPU-backed buffers and mocked driver resource operations. A complete
driver build and GPU execution were not performed.