Skip to content

Commit a8ea8cd

Browse files
committed
ffmpeg: fix memory leak in error case
1 parent a11a58d commit a8ea8cd

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/add-ons/media/plugins/ffmpeg/AVFormatWriter.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -401,6 +401,7 @@ AVFormatWriter::Init(const media_file_format* fileFormat)
401401
fIOContext = avio_alloc_context(buffer, kIOBufferSize, 1, this,
402402
0, _Write, _Seek);
403403
if (fIOContext == NULL) {
404+
av_free(buffer);
404405
TRACE("av_alloc_put_byte() failed!\n");
405406
return B_ERROR;
406407
}

0 commit comments

Comments
 (0)