diff options
author | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2022-08-06 09:18:29 +0200 |
---|---|---|
committer | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2022-08-08 11:42:28 +0200 |
commit | 56973eb6874316b405e37097168b1f2dd89a1e7f (patch) | |
tree | 5f971b06a55b351bf39ddc41530dd2a195cab5c8 /libavcodec | |
parent | d3730acca3a749204f0c312f1be6f4e5f3296f22 (diff) | |
download | ffmpeg-56973eb6874316b405e37097168b1f2dd89a1e7f.tar.gz |
avcodec/nvdec: Use av_buffer_replace() where appropriate
Reviewed-by: Timo Rothenpieler <timo@rothenpieler.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/nvdec.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/libavcodec/nvdec.c b/libavcodec/nvdec.c index 15665b83bb..fbaedf0b6b 100644 --- a/libavcodec/nvdec.c +++ b/libavcodec/nvdec.c @@ -524,12 +524,9 @@ static int nvdec_retrieve_data(void *logctx, AVFrame *frame) goto copy_fail; } - av_buffer_unref(&frame->hw_frames_ctx); - frame->hw_frames_ctx = av_buffer_ref(decoder->real_hw_frames_ref); - if (!frame->hw_frames_ctx) { - ret = AVERROR(ENOMEM); + ret = av_buffer_replace(&frame->hw_frames_ctx, decoder->real_hw_frames_ref); + if (ret < 0) goto copy_fail; - } unmap_data->idx = cf->idx; if (!(unmap_data->idx_ref = av_buffer_ref(cf->idx_ref)) || |