mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-03-17 20:17:55 +02: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 */
|
/* create a 0-terminated string based on the read file */
|
||||||
buf = av_malloc(file_bufsize + 1);
|
buf = av_malloc(file_bufsize + 1);
|
||||||
if (!buf)
|
if (!buf) {
|
||||||
|
av_file_unmap(file_buf, file_bufsize);
|
||||||
return AVERROR(ENOMEM);
|
return AVERROR(ENOMEM);
|
||||||
|
}
|
||||||
memcpy(buf, file_buf, file_bufsize);
|
memcpy(buf, file_buf, file_bufsize);
|
||||||
buf[file_bufsize] = 0;
|
buf[file_bufsize] = 0;
|
||||||
av_file_unmap(file_buf, file_bufsize);
|
av_file_unmap(file_buf, file_bufsize);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user