avutil/hwcontext: Don't check before av_buffer_unref()

av_buffer_unref() can handle AVBufferRef** that point
to a NULL AVBufferRef*.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
Andreas Rheinhardt 2024-02-11 19:08:44 +01:00
parent f705b8b5b4
commit 2e4e424ac2
1 changed files with 1 additions and 2 deletions

View File

@ -297,8 +297,7 @@ AVBufferRef *av_hwframe_ctx_alloc(AVBufferRef *device_ref_in)
return buf;
fail:
if (device_ref)
av_buffer_unref(&device_ref);
av_buffer_unref(&device_ref);
if (ctx->internal)
av_freep(&ctx->internal->priv);
av_freep(&ctx->internal);