diff options
author | Gil Pedersen <git@gpost.dk> | 2020-11-18 13:05:18 +0000 |
---|---|---|
committer | James Almer <jamrial@gmail.com> | 2020-11-19 10:12:58 -0300 |
commit | 7ac1dc23644b54e5b7b43233c1d0a1c398bf87f8 (patch) | |
tree | 68f768ea5e7bd0daf6b0bcc12a285a27c1a2cc4c /libavutil/frame.c | |
parent | 2b6b19dd9bd070cba8673a821f14d26a92d7f0d7 (diff) | |
download | ffmpeg-7ac1dc23644b54e5b7b43233c1d0a1c398bf87f8.tar.gz |
avutil/frame: fix potential leaks in av_frame_ref()
Reviewed-by: Anton Khirnov <anton@khirnov.net>
Signed-off-by: James Almer <jamrial@gmail.com>
Diffstat (limited to 'libavutil/frame.c')
-rw-r--r-- | libavutil/frame.c | 6 |
1 files 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; } |