Fix encoder segfault when a GF group is truncated to one frame - #5302
Merged
Conversation
JimDBh
approved these changes
Aug 21, 2026
define_gf_group() sets max_layer_depth_allowed from gf_max_pyr_height, then set_baseline_gf_interval() can shorten baseline_gf_interval to 1. Nothing rechecks the pyramid height afterwards, so an ARF is scheduled for a group with no room for one and av2_lookahead_peek() returns NULL in the temporal filter. Reproduces with --kf-max-dist=1 --gf-min-pyr-height=2 --enable-fwd-kf=1 on any input. define_gf_group_pass0() already has this guard. Bounded at 2 rather than min_gf_interval so that only the degenerate 1-frame group is affected; all non-crashing streams stay bit-exact.
urvangjoshi
force-pushed
the
mr/avm-bugfix3
branch
from
August 21, 2026 17:59
cce3289 to
565c15c
Compare
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.
define_gf_group() sets max_layer_depth_allowed from gf_max_pyr_height, then set_baseline_gf_interval() can shorten baseline_gf_interval to 1. Nothing rechecks the pyramid height afterwards, so an ARF is scheduled for a group with no room for one and av2_lookahead_peek() returns NULL in the temporal filter.
Reproduces with --kf-max-dist=1 --gf-min-pyr-height=2 --enable-fwd-kf=1 on any input. define_gf_group_pass0() already has this guard.
Bounded at 2 rather than min_gf_interval so that only the degenerate 1-frame group is affected; all non-crashing streams stay bit-exact.
Fix #5301.