[FFmpeg-devel] [PATCH] fftools/ffmpeg_filter: fix leak of AVIOContext in read_binary()
James Almer
jamrial at gmail.com
Fri Apr 28 19:36:39 EEST 2023
It was only being freed on failure.
Signed-off-by: James Almer <jamrial at gmail.com>
---
fftools/ffmpeg_filter.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/fftools/ffmpeg_filter.c b/fftools/ffmpeg_filter.c
index b26160b375..161ea9c866 100644
--- a/fftools/ffmpeg_filter.c
+++ b/fftools/ffmpeg_filter.c
@@ -408,11 +408,13 @@ static int read_binary(const char *path, uint8_t **data, int *len)
*len = fsize;
- return 0;
+ ret = 0;
fail:
avio_close(io);
- av_freep(data);
- *len = 0;
+ if (ret < 0) {
+ av_freep(data);
+ *len = 0;
+ }
return ret;
}
--
2.40.1
More information about the ffmpeg-devel
mailing list