Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefano Sabatini <stefasab@gmail.com>2012-10-23 03:42:24 +0400
committerStefano Sabatini <stefasab@gmail.com>2012-10-24 00:08:55 +0400
commitc7065f1f8953a73fe6eeaeb0cdb8adb5dbe99265 (patch)
tree8715549277ae283fd61c213bf097cba4d50901e0 /libavfilter/f_sendcmd.c
parent469a65b1502505cb8f46938b1b316e4c17a2f2a0 (diff)
lavfi/sendcmd: release file in case of failed allocation
Avoid hanging file.
Diffstat (limited to 'libavfilter/f_sendcmd.c')
-rw-r--r--libavfilter/f_sendcmd.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libavfilter/f_sendcmd.c b/libavfilter/f_sendcmd.c
index 7081de815d..9f1704586e 100644
--- a/libavfilter/f_sendcmd.c
+++ b/libavfilter/f_sendcmd.c
@@ -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);