Browse Source

lavfi/sendcmd: release file in case of failed allocation

Avoid hanging file.
tags/n1.1
Stefano Sabatini 12 years ago
parent
commit
c7065f1f89
1 changed files with 3 additions and 1 deletions
  1. +3
    -1
      libavfilter/f_sendcmd.c

+ 3
- 1
libavfilter/f_sendcmd.c View File

@@ -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…
Cancel
Save