1
0
mirror of https://git.ffmpeg.org/ffmpeg.git synced 2026-10-24 02:09:03 +03:00

avcodec/hevc: keep the active VPS when clearing a layer's SPS

set_sps() with a NULL SPS released s->vps before returning, also when only
a non-base layer was cleared while the base layer keeps decoding. The next
base-layer frame then dereferenced the NULL VPS in ff_hevc_is_alpha_video().
Release s->vps only when a new SPS is installed alongside it.

Assisted-by: Fairy
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
Michael Niedermayer
2026-10-20 15:57:12 +02:00
committed by michaelni
parent 9d106b2bb5
commit 8540c00f1b

View File

@@ -768,6 +768,8 @@ static int set_sps(HEVCContext *s, HEVCLayerContext *l, const HEVCSPS *sps)
if (!sps)
return 0;
av_refstruct_unref(&s->vps);
ret = pic_arrays_init(l, sps);
if (ret < 0)
goto fail;