avcodec/hevc/hevcdec: use av_frame_side_data_add() where useful
Signed-off-by: James Almer <jamrial@gmail.com>
This commit is contained in:
parent
f635f19537
commit
5cd49e1bfd
1 changed files with 4 additions and 7 deletions
|
@ -3095,14 +3095,11 @@ static int set_side_data(HEVCContext *s)
|
|||
return ret;
|
||||
|
||||
if (s->sei.common.dynamic_hdr_vivid.info) {
|
||||
AVBufferRef *info_ref = av_buffer_ref(s->sei.common.dynamic_hdr_vivid.info);
|
||||
if (!info_ref)
|
||||
if (!av_frame_side_data_add(&out->side_data, &out->nb_side_data,
|
||||
AV_FRAME_DATA_DYNAMIC_HDR_VIVID,
|
||||
&s->sei.common.dynamic_hdr_vivid.info,
|
||||
AV_FRAME_SIDE_DATA_FLAG_NEW_REF))
|
||||
return AVERROR(ENOMEM);
|
||||
|
||||
if (!av_frame_new_side_data_from_buf(out, AV_FRAME_DATA_DYNAMIC_HDR_VIVID, info_ref)) {
|
||||
av_buffer_unref(&info_ref);
|
||||
return AVERROR(ENOMEM);
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
|
Loading…
Add table
Reference in a new issue