[FFmpeg-devel] [PATCH] avcodec/vvcdec: frame_context_setup, set fc->ref to NULL

Nuo Mi nuomi2021 at gmail.com
Tue Feb 13 04:30:02 EET 2024


fc->ref points to an old VVCFrame, which cannot be used after frame_context_setup.
This prevents crashes in decode_nal_units-->ff_vvc_report_frame_finished.

Signed-off-by: Frank Plowman <post at frankplowman.com>
---
 libavcodec/vvc/vvcdec.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavcodec/vvc/vvcdec.c b/libavcodec/vvc/vvcdec.c
index 8163b5ecb6..e88e746de4 100644
--- a/libavcodec/vvc/vvcdec.c
+++ b/libavcodec/vvc/vvcdec.c
@@ -594,6 +594,8 @@ static int frame_context_setup(VVCFrameContext *fc, VVCContext *s)
 {
     int ret;
 
+    fc->ref = NULL;
+
     // copy refs from the last frame
     if (s->nb_frames && s->nb_fcs > 1) {
         VVCFrameContext *prev = get_frame_context(s, fc, -1);
-- 
2.25.1



More information about the ffmpeg-devel mailing list