diff options
author | James Almer <jamrial@gmail.com> | 2020-09-29 11:14:07 -0300 |
---|---|---|
committer | James Almer <jamrial@gmail.com> | 2020-12-01 12:31:58 -0300 |
commit | 233a99e1915ef237d2ef298db97680c323dfdd23 (patch) | |
tree | fbf774b9c39c7661a735b24592d010cf2b8780e6 /libavcodec/cbs_av1.c | |
parent | 052b4c3481b034a6187ad0900f1aa3c73016144e (diff) | |
download | ffmpeg-233a99e1915ef237d2ef298db97680c323dfdd23.tar.gz |
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>
Diffstat (limited to 'libavcodec/cbs_av1.c')
-rw-r--r-- | libavcodec/cbs_av1.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/libavcodec/cbs_av1.c b/libavcodec/cbs_av1.c index 9ae2f59872..a40c91adff 100644 --- a/libavcodec/cbs_av1.c +++ b/libavcodec/cbs_av1.c @@ -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); |