Skip to content

fix: add null checks to runaway encode detection#444

Closed
livepeer-tessa wants to merge 1 commit intomasterfrom
fix/runaway-null-checks
Closed

fix: add null checks to runaway encode detection#444
livepeer-tessa wants to merge 1 commit intomasterfrom
fix/runaway-null-checks

Conversation

@livepeer-tessa
Copy link
Contributor

Problem

The runaway encode detection code added in e853093 could potentially crash if:

  1. ictx is null when process_out is called
  2. ictx->ic->iformat->name is null when checking for image2 format

Solution

Added defensive null checks:

  • Check ictx before accessing decoded_res
  • Check iformat->name before calling strcmp

Note on CI Failure

The current CI failure (TestAPI_ConsecutiveMP4s SIGSEGV) 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 the BUILD_TAGS=debug-video build (which uses --disable-optimizations).

This PR addresses the potential null pointer issues but does not fix the CI failure, which needs separate investigation.

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>
@livepeer-tessa
Copy link
Contributor Author

Closing - need local reproduction and fix first

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant