diff options
author | Zhao Zhili <zhilizhao@tencent.com> | 2024-09-15 12:54:16 +0800 |
---|---|---|
committer | Nuo Mi <nuomi2021@gmail.com> | 2024-09-15 16:42:14 +0800 |
commit | 5c66a3ab51807b0f471822ae261dd6b09030a439 (patch) | |
tree | 013c00ed841753ec7697363347f6979534af616f | |
parent | 3f84d1d1fb75e4192c35664b4dd4741e8381b667 (diff) | |
download | ffmpeg-5c66a3ab51807b0f471822ae261dd6b09030a439.tar.gz |
avcodec/vvc: Fix output and unref a frame which isn't decoding yet
ff_vvc_output_frame is called before actually decoding. It's possible
for ff_vvc_output_frame to select current frame to output. If current
frame is nonref frame, it will be released by ff_vvc_unref_frame.
Fix this by always marking the current frame with
VVC_FRAME_FLAG_SHORT_REF, as is done by the HEVC decoder.
-rw-r--r-- | libavcodec/vvc/refs.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/vvc/refs.c b/libavcodec/vvc/refs.c index bebcef7fd6..133ff9eaba 100644 --- a/libavcodec/vvc/refs.c +++ b/libavcodec/vvc/refs.c @@ -193,7 +193,7 @@ int ff_vvc_set_new_ref(VVCContext *s, VVCFrameContext *fc, AVFrame **frame) if (s->no_output_before_recovery_flag && (IS_RASL(s) || !GDR_IS_RECOVERED(s))) ref->flags = VVC_FRAME_FLAG_SHORT_REF; else if (ph->r->ph_pic_output_flag) - ref->flags = VVC_FRAME_FLAG_OUTPUT; + ref->flags = VVC_FRAME_FLAG_OUTPUT | VVC_FRAME_FLAG_SHORT_REF; if (!ph->r->ph_non_ref_pic_flag) ref->flags |= VVC_FRAME_FLAG_SHORT_REF; |