Skip to content

Commit 5c66a3a

Browse files
quink-blacknuomi2021
authored andcommitted
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.
1 parent 3f84d1d commit 5c66a3a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

libavcodec/vvc/refs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ int ff_vvc_set_new_ref(VVCContext *s, VVCFrameContext *fc, AVFrame **frame)
193193
if (s->no_output_before_recovery_flag && (IS_RASL(s) || !GDR_IS_RECOVERED(s)))
194194
ref->flags = VVC_FRAME_FLAG_SHORT_REF;
195195
else if (ph->r->ph_pic_output_flag)
196-
ref->flags = VVC_FRAME_FLAG_OUTPUT;
196+
ref->flags = VVC_FRAME_FLAG_OUTPUT | VVC_FRAME_FLAG_SHORT_REF;
197197

198198
if (!ph->r->ph_non_ref_pic_flag)
199199
ref->flags |= VVC_FRAME_FLAG_SHORT_REF;

0 commit comments

Comments
 (0)