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>
This commit is contained in:
James Almer 2023-04-28 13:35:19 -03:00
parent af8be7bf43
commit 1b7c13e1a4

View File

@ -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;
}