diff --git a/libavcodec/cuviddec.c b/libavcodec/cuviddec.c index 331851231fa17bb821da804e3ecc2078476ea582..49775b5a09c82fe1f2ac0a4d11c5661028a0a0a9 100644 --- a/libavcodec/cuviddec.c +++ b/libavcodec/cuviddec.c @@ -634,6 +634,9 @@ FF_ENABLE_DEPRECATION_WARNINGS } error: + if (ret < 0) + av_frame_unref(frame); + if (mapped_frame) eret = CHECK_CU(ctx->cvdl->cuvidUnmapVideoFrame(ctx->cudecoder, mapped_frame));