mirror of https://git.ffmpeg.org/ffmpeg.git
avcodec/cbs_av1: ensure Sequence Header unit content is always reference counted
Prevents a NULL pointer dereference. Signed-off-by: James Almer <jamrial@gmail.com>
This commit is contained in:
parent
052b4c3481
commit
233a99e191
|
@ -1076,6 +1076,10 @@ static int cbs_av1_write_obu(CodedBitstreamContext *ctx,
|
|||
av_buffer_unref(&priv->sequence_header_ref);
|
||||
priv->sequence_header = NULL;
|
||||
|
||||
err = ff_cbs_make_unit_refcounted(ctx, unit);
|
||||
if (err < 0)
|
||||
return err;
|
||||
|
||||
priv->sequence_header_ref = av_buffer_ref(unit->content_ref);
|
||||
if (!priv->sequence_header_ref)
|
||||
return AVERROR(ENOMEM);
|
||||
|
|
Loading…
Reference in New Issue