]> git.sesse.net Git - ffmpeg/commitdiff
avcodec/cuviddec: unref output frame on failure
authorJames Almer <jamrial@gmail.com>
Sun, 13 Dec 2020 18:08:13 +0000 (15:08 -0300)
committerJames Almer <jamrial@gmail.com>
Sun, 13 Dec 2020 18:50:42 +0000 (15:50 -0300)
Signed-off-by: James Almer <jamrial@gmail.com>
libavcodec/cuviddec.c

index 331851231fa17bb821da804e3ecc2078476ea582..49775b5a09c82fe1f2ac0a4d11c5661028a0a0a9 100644 (file)
@@ -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));