Skip to content

Fix encoder segfault when a GF group is truncated to one frame - #5302

Merged
urvangjoshi merged 1 commit into
AOMediaCodec:mainfrom
xinzhao-apple:mr/avm-bugfix3
Aug 21, 2026
Merged

Fix encoder segfault when a GF group is truncated to one frame#5302
urvangjoshi merged 1 commit into
AOMediaCodec:mainfrom
xinzhao-apple:mr/avm-bugfix3

Conversation

@xinzhao-apple

Copy link
Copy Markdown
Contributor

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.

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
urvangjoshi merged commit 4bdc679 into AOMediaCodec:main Aug 21, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Encoder segfault related to GF pyramid after the group is truncated to one frame

4 participants