mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-01-06 07:10:21 +00:00
lavfi/sendcmd: release file in case of failed allocation
Avoid hanging file.
This commit is contained in:
parent
469a65b150
commit
c7065f1f89
@ -398,8 +398,10 @@ static av_cold int init(AVFilterContext *ctx, const char *args)
|
||||
|
||||
/* create a 0-terminated string based on the read file */
|
||||
buf = av_malloc(file_bufsize + 1);
|
||||
if (!buf)
|
||||
if (!buf) {
|
||||
av_file_unmap(file_buf, file_bufsize);
|
||||
return AVERROR(ENOMEM);
|
||||
}
|
||||
memcpy(buf, file_buf, file_bufsize);
|
||||
buf[file_bufsize] = 0;
|
||||
av_file_unmap(file_buf, file_bufsize);
|
||||
|
Loading…
Reference in New Issue
Block a user