Skip to content

fix(test): zero-initialise the SAD arrays of the motion-window stream tests - #2645

Closed
lusoris wants to merge 2 commits into
masterfrom
fix/cppcheck-motion-window-sad
Closed

lusoris wants to merge 2 commits into
masterfrom
fix/cppcheck-motion-window-sad

Conversation

@lusoris

@lusoris lusoris commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

Summary

The Cppcheck job of the Lint workflow is red on master (runs 37825729216 on a6d8d22b4, 37831307977 on 8493fcd9d). The report artifact lists two uninitvar findings, both in core/test/test_motion_window_incremental.c: sad (lines 256 and 289) is passed to mwi_values_match() after a loop that fills it element by element, and the tool cannot see that every element read has been written. sad is now zero-initialised in both functions that declare it. The gate and the suppression list are unchanged.

Type

  • fix — bug fix
  • test — test-only

Checklist

  • Commits follow Conventional Commits (the commit-msg hook enforces this).
  • Every commit is signed off (git commit -s; fix a branch with git rebase --signoff origin/master). See DCO sign-off.
  • make format && make lint is green locally.
  • Unit tests pass — the change only initialises test-local arrays.

Bug-status hygiene (ADR-0165)

  • docs/state.md updated in this PR with a row in Recently closed.

Netflix golden-data gate (ADR-0024)

  • I did not modify any assertAlmostEqual(...) score in the Netflix golden Python tests.

Deep-dive deliverables (ADR-0108)

  • Research digest — no digest needed: trivial.
  • Decision matrix — no alternatives: only-one-way fix.
  • AGENTS.md invariant note — no rebase-sensitive invariants.
  • Reproducer / smoke-test command — pasted below under "Reproducer".
  • CHANGELOG fragment — no changelog needed: test-only change.
  • Rebase note — no rebase impact: test-only.

Reproducer

gh run download 37825729216 -R VMAFx/vmafx -n cppcheck-report   # two uninitvar findings
cppcheck --enable=warning,performance,portability --check-level=exhaustive --inline-suppr \
  --library=build/cppcheck-posix-vmafx.cfg --library=scripts/ci/cppcheck-public-entrypoints.cfg \
  --suppressions-list=.cppcheck-suppressions.txt --project=build/compile_commands.json --error-exitcode=1

I could not reproduce the two findings locally: cppcheck 2.22.0 (host, full compile database) and 2.13.0 (Ubuntu 24.04 container, single file with the CI defines) both report nothing for this file. The proof is this pull request's own Cppcheck job, which runs the CI configuration.

Known follow-ups

None.

… tests

Signed-off-by: Lusoris <lusoris@proton.me>
Signed-off-by: Lusoris <lusoris@proton.me>
@github-actions github-actions Bot added the type:bug Something isn't working label Oct 8, 2026
@lusoris

lusoris commented Oct 9, 2026

Copy link
Copy Markdown
Contributor Author

Superseded by #2671, the same fix rebased on current master.

@lusoris lusoris closed this Oct 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type:bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant