Repository navigation
Conversation
lusoris
enabled auto-merge (squash)
May 29, 2026 10:27
lusoris
force-pushed
the
fix/feature-dictionary-ownership-0806
branch
from
May 29, 2026 11:33
51894e7 to
ee60d0a
Compare
lusoris
disabled auto-merge
May 29, 2026 11:43
lusoris
marked this pull request as draft
May 29, 2026 11:43
…llers (ADR-0806) Two bugs in fork-local test files: 1. Double-free (CWE-415) in test_vif_skip_scale0.c: the error path called vmaf_feature_dictionary_free(&opts) after vmaf_use_feature(), which already frees opts unconditionally (both on success and failure). Fix: remove the redundant free; add opts = NULL sentinel and ADR-0806 comment. 2. Leak (CWE-401) in test_integer_vif_cpu_cuda_parity.c: run_cuda_vif() returned early on the "no CUDA device" path without freeing chroma_opts, which had been allocated by the caller but never consumed by vmaf_use_feature(). Fix: call vmaf_feature_dictionary_free(&opts) before the early return (safe for NULL opts per the API contract). Also corrects copyright headers (Lusoris only, per project memory). Ownership contract codified in ADR-0806. no rebase impact: all changed files are fork-added tests + docs. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
lusoris
force-pushed
the
fix/feature-dictionary-ownership-0806
branch
from
May 29, 2026 12:13
ee60d0a to
3dc59ae
Compare
Contributor
Author
|
Contaminated (59 files) — needs reconstruction, skipping rebase per session policy |
lusoris
marked this pull request as ready for review
May 31, 2026 13:36
lusoris
marked this pull request as draft
May 31, 2026 13:54
lusoris
marked this pull request as ready for review
May 31, 2026 14:03
Contributor
Author
|
Closing as part of marathon cleanup 2026-05-31 (150 PRs merged today). Content likely superseded by sibling merges. Reopen if specific finding still needs work; bigger PRs preferred going forward per session feedback. |
Contributor
Author
|
Superseded by #515 — bundled into one PR per bigger-PRs guidance. All three diffs preserved verbatim. |
lusoris
added a commit
that referenced
this pull request
Jun 2, 2026
…ool UAF/leak + #187 feature-dict double-free) - GPU pool UAF: clear *pool on every init() failure path so callers can't double-free a dangling pointer in vmaf_gpu_picture_pool_close() (ADR-0778). - picture_pool prealloc leak: two-pass approach — allocate all pictures first, then strip priv/ref; error unwind uses vmaf_picture_unref on intact pictures instead of manual aligned_free on already-detached data (ADR-0778 Fix-E). - feature-dict double-free: move feature-dictionary ownership into feature_collector; extractors no longer free dicts they don't own (ADR-0806). Rebased onto master (aa17751) — resolved add/add conflicts in .github/workflows/ by keeping the core/ path refs from master. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
lusoris
added a commit
that referenced
this pull request
Jun 2, 2026
…ool UAF/leak + #187 feature-dict double-free) (#515) - GPU pool UAF: clear *pool on every init() failure path so callers can't double-free a dangling pointer in vmaf_gpu_picture_pool_close() (ADR-0778). - picture_pool prealloc leak: two-pass approach — allocate all pictures first, then strip priv/ref; error unwind uses vmaf_picture_unref on intact pictures instead of manual aligned_free on already-detached data (ADR-0778 Fix-E). - feature-dict double-free: move feature-dictionary ownership into feature_collector; extractors no longer free dicts they don't own (ADR-0806). Rebased onto master (aa17751) — resolved add/add conflicts in .github/workflows/ by keeping the core/ path refs from master. Co-authored-by: Lusoris <lusoris@pm.me> Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
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.
Summary
core/test/test_vif_skip_scale0.c: error path calledvmaf_feature_dictionary_free(&opts)aftervmaf_use_feature(), which already unconditionally freesoptson both success and failure paths. Fix: remove the redundant free; addopts = NULLsentinel + ADR-0806 comment.core/test/test_integer_vif_cpu_cuda_parity.c:run_cuda_vif()returned early (no CUDA device) without freeingchroma_opts, which had been allocated by the caller but never reachedvmaf_use_feature(). Fix: callvmaf_feature_dictionary_free(&opts)on the early-return path (safe for NULL per API contract).Lusorisonly (per project memory, 2026-05-27).vmaf_use_featureandvmaf_model_feature_overloadalways take ownership of the dict argument.No production code changed. No golden assertions touched.
Deliverables checklist
## Alternatives consideredmeson test -C build --suite=fast— double-free detectable with ASan; leak detectable with LSANchangelog.d/fixed/0806-feature-dictionary-ownership.mdTest plan
meson test -C build test_vif_skip_scale0passesmeson test -C build test_integer_vif_cpu_cuda_paritypasses (skips gracefully without CUDA device)make test(ASan + UBSan) shows no double-free or leak in affected tests🤖 Generated with Claude Code