ffmpeg: fix memory leak in error case
This commit is contained in:
@@ -401,6 +401,7 @@ AVFormatWriter::Init(const media_file_format* fileFormat)
|
|||||||
fIOContext = avio_alloc_context(buffer, kIOBufferSize, 1, this,
|
fIOContext = avio_alloc_context(buffer, kIOBufferSize, 1, this,
|
||||||
0, _Write, _Seek);
|
0, _Write, _Seek);
|
||||||
if (fIOContext == NULL) {
|
if (fIOContext == NULL) {
|
||||||
|
av_free(buffer);
|
||||||
TRACE("av_alloc_put_byte() failed!\n");
|
TRACE("av_alloc_put_byte() failed!\n");
|
||||||
return B_ERROR;
|
return B_ERROR;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user