[FFmpeg-cvslog] fftools/ffprobe: Fix memleak

Andreas Rheinhardt git at videolan.org
Tue Aug 1 17:48:59 EEST 2023


ffmpeg | branch: master | Andreas Rheinhardt <andreas.rheinhardt at outlook.com> | Mon Jul 31 11:32:18 2023 +0200| [0e9956a06e9307e01232bc354665fadf6f7a09df] | committer: Andreas Rheinhardt

fftools/ffprobe: Fix memleak

Fixes Coverity issue #1524491.
Regression since e6126abc6997058ca49ee596b70611bbe367163e.

Reviewed-by: James Almer <jamrial at gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at outlook.com>

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

 fftools/ffprobe.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/fftools/ffprobe.c b/fftools/ffprobe.c
index 81610c097b..5c2d4cbff1 100644
--- a/fftools/ffprobe.c
+++ b/fftools/ffprobe.c
@@ -2929,8 +2929,10 @@ static int read_interval_packets(WriterContext *w, InputFile *ifile,
                 FrameData *fd;
 
                 pkt->opaque_ref = av_buffer_allocz(sizeof(*fd));
-                if (!pkt->opaque_ref)
-                    return AVERROR(ENOMEM);
+                if (!pkt->opaque_ref) {
+                    ret = AVERROR(ENOMEM);
+                    goto end;
+                }
                 fd = (FrameData*)pkt->opaque_ref->data;
                 fd->pkt_pos  = pkt->pos;
                 fd->pkt_size = pkt->size;



More information about the ffmpeg-cvslog mailing list