PR #26082 opened by michaelni
URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/26082
Patch URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/26082.patch

82b7a19f4a1 and 8540c00f1bd fixed the same bug, each adding its own
av_refstruct_unref(&s->vps). The one from 8540c00f1bd runs before
pic_arrays_init() and so drops the active VPS when that fails for a
non-base layer, the next base layer frame then dereferences the NULL VPS
in ff_hevc_is_alpha_video().

Fixes: NULL pointer dereference

Signed-off-by: Michael Niedermayer <[email protected]>



>From 013087a6648dce37ea9bda6dbaf808ff34dfa197 Mon Sep 17 00:00:00 2001
From: Michael Niedermayer <[email protected]>
Date: Sun, 15 Nov 2026 02:12:57 +0100
Subject: [PATCH] avcodec/hevc: remove duplicate VPS release from set_sps()

82b7a19f4a1 and 8540c00f1bd fixed the same bug, each adding its own
av_refstruct_unref(&s->vps). The one from 8540c00f1bd runs before
pic_arrays_init() and so drops the active VPS when that fails for a
non-base layer, the next base layer frame then dereferences the NULL VPS
in ff_hevc_is_alpha_video().

Fixes: NULL pointer dereference

Signed-off-by: Michael Niedermayer <[email protected]>
---
 libavcodec/hevc/hevcdec.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/libavcodec/hevc/hevcdec.c b/libavcodec/hevc/hevcdec.c
index 0934f640966..06688306bd0 100644
--- a/libavcodec/hevc/hevcdec.c
+++ b/libavcodec/hevc/hevcdec.c
@@ -768,8 +768,6 @@ 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;
-- 
2.54.0

_______________________________________________
ffmpeg-devel mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to