1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-04-08 16:54:03 +02:00

fftools/ffmpeg_filter: fix leak of AVIOContext in read_binary()

It was only being freed on failure.

Reviewed-by: Anton Khirnov <anton@khirnov.net>
Signed-off-by: James Almer <jamrial@gmail.com>
(cherry picked from commit 1b7c13e1a437d7db84a206e5c55b0e0aa95760ec)
This commit is contained in:
James Almer 2023-04-28 13:35:19 -03:00
parent 8f61cbf1b9
commit 27205c0b47

View File

@ -352,11 +352,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;
}