[FFmpeg-cvslog] avcodec/cuviddec: unref output frame on failure

James Almer git at videolan.org
Mon Dec 14 02:52:12 EET 2020


ffmpeg | branch: master | James Almer <jamrial at gmail.com> | Sun Dec 13 15:08:13 2020 -0300| [cd821c18dc8bc5949f4b4d13f07157928ae22bba] | committer: James Almer

avcodec/cuviddec: unref output frame on failure

Signed-off-by: James Almer <jamrial at gmail.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=cd821c18dc8bc5949f4b4d13f07157928ae22bba
---

 libavcodec/cuviddec.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/libavcodec/cuviddec.c b/libavcodec/cuviddec.c
index 331851231f..49775b5a09 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));
 



More information about the ffmpeg-cvslog mailing list