Bug 829461: Check for NULL media stream r=ehugg

This commit is contained in:
Adam Roach [:abr] 2013-01-17 15:32:16 -06:00
Родитель a8b6e7b1cd
Коммит d1649a65c9
2 изменённых файлов: 14 добавлений и 5 удалений

Просмотреть файл

@ -167,13 +167,18 @@ public:
case REMOTESTREAMADD:
{
nsDOMMediaStream* stream;
nsDOMMediaStream* stream = nullptr;
uint32_t hint;
if (!mRemoteStream) {
CSFLogErrorS(logTag, __FUNCTION__ << " GetRemoteStream returned NULL");
} else {
stream = mRemoteStream->GetMediaStream();
}
if (!stream) {
CSFLogErrorS(logTag, __FUNCTION__ << " GetMediaStream returned NULL");
} else {
hint = stream->GetHintContents();
if (hint == nsDOMMediaStream::HINT_CONTENTS_AUDIO) {
mObserver->OnAddStream(stream, "audio");

Просмотреть файл

@ -49,7 +49,7 @@ class Fake_AudioGenerator {
public:
Fake_AudioGenerator(nsDOMMediaStream* aStream) : mStream(aStream), mCount(0) {
mTimer = do_CreateInstance("@mozilla.org/timer;1");
PR_ASSERT(mTimer);
MOZ_ASSERT(mTimer);
// Make a track
mozilla::AudioSegment *segment = new mozilla::AudioSegment();
@ -92,7 +92,7 @@ class Fake_VideoGenerator {
mStream = aStream;
mCount = 0;
mTimer = do_CreateInstance("@mozilla.org/timer;1");
PR_ASSERT(mTimer);
MOZ_ASSERT(mTimer);
// Make a track
mozilla::VideoSegment *segment = new mozilla::VideoSegment();
@ -161,7 +161,9 @@ class Fake_VideoGenerator {
class LocalSourceStreamInfo {
public:
LocalSourceStreamInfo(nsDOMMediaStream* aMediaStream)
: mMediaStream(aMediaStream) {}
: mMediaStream(aMediaStream) {
MOZ_ASSERT(aMediaStream);
}
~LocalSourceStreamInfo() {
mMediaStream = NULL;
}
@ -198,7 +200,9 @@ class RemoteSourceStreamInfo {
public:
RemoteSourceStreamInfo(nsDOMMediaStream* aMediaStream) :
mMediaStream(already_AddRefed<nsDOMMediaStream>(aMediaStream)),
mPipelines() {}
mPipelines() {
MOZ_ASSERT(aMediaStream);
}
nsDOMMediaStream* GetMediaStream() {
return mMediaStream;