зеркало из https://github.com/mozilla/gecko-dev.git
Bug 573050: Properly initialize variables to avoid mallocing on bad data in the raw decoder. r=doublec
This commit is contained in:
Родитель
ccc69fca65
Коммит
07f85bbcb9
|
@ -47,7 +47,7 @@
|
|||
|
||||
nsRawReader::nsRawReader(nsBuiltinDecoder* aDecoder)
|
||||
: nsBuiltinDecoderReader(aDecoder),
|
||||
mCurrentFrame(0)
|
||||
mCurrentFrame(0), mFrameSize(0)
|
||||
{
|
||||
MOZ_COUNT_CTOR(nsRawReader);
|
||||
}
|
||||
|
@ -174,6 +174,9 @@ PRBool nsRawReader::DecodeVideoFrame(PRBool &aKeyframeSkip,
|
|||
NS_ASSERTION(mDecoder->OnStateMachineThread() || mDecoder->OnDecodeThread(),
|
||||
"Should be on state machine thread or decode thread.");
|
||||
|
||||
if (!mFrameSize)
|
||||
return PR_FALSE; // Metadata read failed. We should refuse to play.
|
||||
|
||||
PRInt64 currentFrameTime = 1000 * mCurrentFrame / mFrameRate;
|
||||
PRUint32 length = mFrameSize - sizeof(nsRawPacketHeader);
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче