This is an automated email from the git hooks/post-receive script.

Git pushed a commit to branch master
in repository ffmpeg.

commit 82b7a19f4a18425dd17df4156062f8103da624f9
Author:     Michael Niedermayer <[email protected]>
AuthorDate: Sun Oct 11 07:15:19 2026 +0200
Commit:     michaelni <[email protected]>
CommitDate: Mon Oct 12 21:18:53 2026 +0000

    avcodec/hevc: keep the active VPS when a layer SPS is cleared
    
    set_sps(s, l, NULL) drops the SPS of a non-base layer whose VPS does not
    match the active one. It also dropped the active VPS of the base layer,
    the next base layer frame then dereferenced the NULL VPS in
    ff_hevc_is_alpha_video().
    
    Fixes: NULL pointer dereference
    Fixes: 4WKa0bETBVfE
    Regression since: c7f0753a6b
    Found during the review of https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/24895
    NULL pointer dereference Replicated through UnModified FFmpeg with ASAN
---
 libavcodec/hevc/hevcdec.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libavcodec/hevc/hevcdec.c b/libavcodec/hevc/hevcdec.c
index a36ea57bc2..4f40862c29 100644
--- a/libavcodec/hevc/hevcdec.c
+++ b/libavcodec/hevc/hevcdec.c
@@ -764,7 +764,6 @@ static int set_sps(HEVCContext *s, HEVCLayerContext *l, 
const HEVCSPS *sps)
 
     pic_arrays_free(l);
     av_refstruct_unref(&l->sps);
-    av_refstruct_unref(&s->vps);
 
     if (!sps)
         return 0;
@@ -773,6 +772,8 @@ static int set_sps(HEVCContext *s, HEVCLayerContext *l, 
const HEVCSPS *sps)
     if (ret < 0)
         goto fail;
 
+    av_refstruct_unref(&s->vps);
+
     ff_hevc_pred_init(&s->hpc,     sps->bit_depth);
     ff_hevc_dsp_init (&s->hevcdsp, sps->bit_depth);
     ff_videodsp_init (&s->vdsp,    sps->bit_depth);

-- 
To stop receiving notification emails like this one, please contact
[email protected].
_______________________________________________
ffmpeg-cvslog mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to