← Back to Pull requests

avifDecoderReset: only inspect the first color tile if color tiles exist #3426

Closed
unknown closed this pull request without merging on Nov 06, 2026 09:01 UTC
View on GitHub
unknown unknown commented on Oct 26, 2026 12:47 UTC
Author

Problem

avifDecoderReset() checks the first colour tile whenever the primary
colour item's progressive flag is set. That flag is set during tile
generation and never cleared, but Reset first clears all tiles
(tiles.count = 0, tile->input = NULL).

So this sequence crashes:

1. Parse a progressive AVIF with colour enabled.
2. Change imageContentToDecode to exclude colour.
3. Call avifDecoderReset().

Reset re-enters with the flag still set but no colour tiles, and reads
samples.count through a NULL input pointer (NULL + 0xc). ASan
reports a SEGV at src/read.c:6655 in avifDecoderReset. Changing
imageContentToDecode between Reset calls is already used in the test
suite (avifgainmaptest.cc, avif_fuzztest_dec.cc).

Impact: crash-only NULL dereference. No memory corruption, information
disclosure, or attacker control over the faulting address.

Fix

Also require data->tileInfos[AVIF_ITEM_COLOR].tileCount > 0 before
entering the block — the same check used nearby for whether tiles were
generated for a category. If no colour tiles were generated, there is
no progressive colour state to report. One line in src/read.c.

Testing

Adds DecodeProgressiveTest.ResetAfterExcludingColor to
tests/gtest/avifprogressivetest.cc, with
tests/data/white_1x1_a1lx_progressive.avif. The test runs the
sequence above through the public API: unpatched, it dies with the
same SEGV at src/read.c:6655; patched, it passes.

Also checked with an ASan build and public-API harness: patched
returns AVIF_RESULT_OK; parsing the crafted file with colour still
reports progressiveState AVAILABLE; the non-progressive donor file
is unaffected.

Diff: 209 lines (+156 / -53) across 2 files Reviewer: y-guyon Review duration: 15613m
All Vouch review confidence checks passed
Residual risk 0.14 = Change Risk (0.36) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.36 · 209 lines diff across 2 files
0.36
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
0.17
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
60%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size diff_size
0.320
Shallow Review Depth shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #3426"
general weight: 0.35
Reviewers
Assignees
Unassigned
Labels
risk: low confidence: 60.5% reviewed
Vouch Risk Breakdown
AI-powered review risk analysis
Change Risk
Change Risk · Model 1 (XGBoost)
Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
Score: 36.4% (MEDIUM) · Higher = larger blast radius
36.4%
Review Confidence
Review Confidence · Models 2 & 3
Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
Score: 60.5% · Lower = rushed or shallow review
60.5%
Residual Risk
Residual Risk · Core Equation
Residual = Change × (1 − Confidence)
Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
Score: 14.4% · Safe to merge
14.4%