mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-03 02:25:34 +00:00
Bug 1058399 - Fix VideoData leak on osx fmp4 seek. r=cpearce
Calling Clear() on the reorder queue doesn't call delete on the stored pointer elements. Do this explicitly to avoid leaking decoded frames when ::Flush() is called.
This commit is contained in:
parent
d963e4ab08
commit
b50a25ed3d
@ -119,7 +119,8 @@ AppleVTDecoder::Flush()
|
||||
if (NS_FAILED(rv)) {
|
||||
LOG("AppleVTDecoder::Drain failed waiting for platform decoder.");
|
||||
}
|
||||
mReorderQueue.Clear();
|
||||
ClearReorderedFrames();
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
||||
@ -221,6 +222,14 @@ AppleVTDecoder::DrainReorderedFrames()
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
AppleVTDecoder::ClearReorderedFrames()
|
||||
{
|
||||
while (!mReorderQueue.IsEmpty()) {
|
||||
delete mReorderQueue.Pop();
|
||||
}
|
||||
}
|
||||
|
||||
// Copy and return a decoded frame.
|
||||
nsresult
|
||||
AppleVTDecoder::OutputFrame(CVPixelBufferRef aImage,
|
||||
|
@ -54,6 +54,7 @@ private:
|
||||
nsresult InitializeSession();
|
||||
nsresult WaitForAsynchronousFrames();
|
||||
void DrainReorderedFrames();
|
||||
void ClearReorderedFrames();
|
||||
};
|
||||
|
||||
} // namespace mozilla
|
||||
|
Loading…
Reference in New Issue
Block a user