[FFmpeg-cvslog] avutil/frame: fix potential leaks in av_frame_ref()

Gil Pedersen git at videolan.org
Thu Nov 19 15:13:55 EET 2020


ffmpeg | branch: master | Gil Pedersen <git at gpost.dk> | Wed Nov 18 13:05:18 2020 +0000| [7ac1dc23644b54e5b7b43233c1d0a1c398bf87f8] | committer: James Almer

avutil/frame: fix potential leaks in av_frame_ref()

Reviewed-by: Anton Khirnov <anton at khirnov.net>
Signed-off-by: James Almer <jamrial at gmail.com>

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

 libavutil/frame.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/libavutil/frame.c b/libavutil/frame.c
index 42d3009212..b019779b1a 100644
--- a/libavutil/frame.c
+++ b/libavutil/frame.c
@@ -456,17 +456,17 @@ int av_frame_ref(AVFrame *dst, const AVFrame *src)
 
     ret = frame_copy_props(dst, src, 0);
     if (ret < 0)
-        return ret;
+        goto fail;
 
     /* duplicate the frame data if it's not refcounted */
     if (!src->buf[0]) {
         ret = av_frame_get_buffer(dst, 0);
         if (ret < 0)
-            return ret;
+            goto fail;
 
         ret = av_frame_copy(dst, src);
         if (ret < 0)
-            av_frame_unref(dst);
+            goto fail;
 
         return ret;
     }



More information about the ffmpeg-cvslog mailing list