Bug 981966 - fix OggWriter memory leak; r=kinetik,f=mccr8

This commit is contained in:
Nathan Froyd 2014-03-11 14:17:02 -04:00
parent 5d919b2c6e
commit 5f69aa4f0e
2 changed files with 9 additions and 0 deletions

View File

@ -22,6 +22,14 @@ OggWriter::OggWriter() : ContainerWriter()
}
}
OggWriter::~OggWriter()
{
if (mInitialized) {
ogg_stream_clear(&mOggStreamState);
}
// mPacket's data was always owned by us, no need to ogg_packet_clear.
}
nsresult
OggWriter::Init()
{

View File

@ -22,6 +22,7 @@ class OggWriter : public ContainerWriter
{
public:
OggWriter();
~OggWriter();
nsresult WriteEncodedTrack(const EncodedFrameContainer &aData,
uint32_t aFlags = 0) MOZ_OVERRIDE;