ffmpeg: fix memory leak in error case

This commit is contained in:
Adrien Destugues 2020-08-05 23:07:48 +02:00
parent a11a58d4d0
commit a8ea8cd1d4

View File

@ -401,6 +401,7 @@ AVFormatWriter::Init(const media_file_format* fileFormat)
fIOContext = avio_alloc_context(buffer, kIOBufferSize, 1, this,
0, _Write, _Seek);
if (fIOContext == NULL) {
av_free(buffer);
TRACE("av_alloc_put_byte() failed!\n");
return B_ERROR;
}