Bug 1181909 - Fix potential null dereference in NextPartObserver. r=tn

This commit is contained in:
Seth Fowler 2015-07-09 09:21:22 -07:00
parent 41514eb38a
commit 8cfbba9a8c

View File

@ -42,7 +42,12 @@ public:
mImage->GetFrame(imgIContainer::FRAME_CURRENT,
imgIContainer::FLAG_SYNC_DECODE);
FinishObserving();
// GetFrame() should've sent synchronous notifications that would have
// caused us to call FinishObserving() (and null out mImage) already. If for
// some reason it didn't, we should do so here.
if (mImage) {
FinishObserving();
}
}
virtual void Notify(int32_t aType,