Closed Bug 1231627 Opened 9 years ago Closed 8 years ago

[Static Analysis][Unchecked return value] In function WebGLContextLossHandler::RunTimer() from WebGLContextLossHandler.cpp

Categories

(Core :: Graphics: CanvasWebGL, defect)

defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 1280507
Tracking Status
firefox45 --- affected

People

(Reporter: andi, Assigned: andi)

References

(Blocks 1 open bug)

Details

(Keywords: coverity, Whiteboard: CID 1327929)

Attachments

(1 file)

The Static Analysis tool Coverity added that return value from workerPrivate->AddFeature(workerPrivate->GetJSContext(), this) is not checked.

>>        if (!mFeatureAdded) {
>>            workerPrivate->AddFeature(workerPrivate->GetJSContext(), this);
>>            mFeatureAdded = true;
>>        }

I've added these lines of code:
>>       if(NS_WARN_IF(!workerPrivate->AddFeature(workerPrivate->GetJSContext(), this)))
>>          return;
>>      else    
>>          mFeatureAdded = true;

That when AddFeature fails and it get called dirrectly from TimerCallback we should also be blocked by the assert and to signal a potential issue:

>>    if (mShouldRunTimerAgain) {
>>        RunTimer();
>>        MOZ_ASSERT(mIsTimerRunning);
>>    }

Now i'm not sure that we should have the return in the event AddFeature fails, but i put it there in order to signal that we no longer trigger a StartTimer.
Attached patch Bug 1231627.diffSplinter Review
Attachment #8697229 - Flags: review?(jmuizelaar)
Attachment #8697229 - Flags: review?(jmuizelaar) → review?(jgilbert)
Duping this to bug 1280507, since that bug removes this code.
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → DUPLICATE
Attachment #8697229 - Flags: review?(jgilbert)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: