lavfi/sendcmd: release file in case of failed allocation

Avoid hanging file.
This commit is contained in:
Stefano Sabatini 2012-10-23 01:42:24 +02:00
parent 469a65b150
commit c7065f1f89

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);