fix: add null checks to runaway encode detection#444
Closed
livepeer-tessa wants to merge 1 commit intomasterfrom
Closed
fix: add null checks to runaway encode detection#444livepeer-tessa wants to merge 1 commit intomasterfrom
livepeer-tessa wants to merge 1 commit intomasterfrom
Conversation
Adds defensive null checks to the runaway encode detection code: - Check ictx is not null before accessing decoded_res - Check iformat->name is not null before strcmp These prevent potential segfaults when encountering edge cases. Note: This does not fix the pre-existing CI failure which appears to be a threading/memory issue in the ffmpeg libraries when running with BUILD_TAGS=debug-video (--disable-optimizations). Signed-off-by: livepeer-tessa <livepeer-tessa@users.noreply.github.com>
Contributor
Author
|
Closing - need local reproduction and fix first |
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.
Problem
The runaway encode detection code added in e853093 could potentially crash if:
ictxis null whenprocess_outis calledictx->ic->iformat->nameis null when checking for image2 formatSolution
Added defensive null checks:
ictxbefore accessingdecoded_resiformat->namebefore callingstrcmpNote on CI Failure
The current CI failure (
TestAPI_ConsecutiveMP4sSIGSEGV) is a pre-existing issue that also occurs on the previous commit (16fd62b). The crash is happening inside the ffmpeg libraries, not in LPMS code, and appears to be related to theBUILD_TAGS=debug-videobuild (which uses--disable-optimizations).This PR addresses the potential null pointer issues but does not fix the CI failure, which needs separate investigation.