[FFmpeg-devel] [PATCH 1/5] fftools/ffprobe: Fix memleak
Stefano Sabatini
stefasab at gmail.com
Wed Aug 2 08:13:03 EEST 2023
On date Monday 2023-07-31 13:08:37 +0200, Andreas Rheinhardt wrote:
> Fixes Coverity issue #1524491.
> Regression since e6126abc6997058ca49ee596b70611bbe367163e.
>
> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at outlook.com>
> ---
> 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;
LGTM, thanks.
More information about the ffmpeg-devel
mailing list