Closed Bug 1230911 Opened 4 years ago Closed 4 years ago

[Static Analysis][Dereference before null check] In function TextureClient::CreateForDrawing from TextureClient.cpp

Categories

(Core :: Graphics: Layers, defect)

defect
Not set

Tracking

()

RESOLVED FIXED
mozilla46
Tracking Status
firefox45 --- affected
firefox46 --- fixed

People

(Reporter: andi, Assigned: andi)

References

(Blocks 1 open bug)

Details

(Keywords: coverity, Whiteboard: CID 1338038)

Attachments

(1 file, 1 obsolete file)

The Static Analysis tool Coverity added that pointer aAllocator is dereferenced before null check, that could resul to a null poinder dereference.
Attached patch Bug 1230911.diff (obsolete) — Splinter Review
Hello Robert,

Can you please take a look other this patch?

THX
Attachment #8696442 - Flags: review?(roc)
Blocks: 1230912
No longer blocks: 1230912
Comment on attachment 8696442 [details] [diff] [review]
Bug 1230911.diff

Review of attachment 8696442 [details] [diff] [review]:
-----------------------------------------------------------------

::: gfx/layers/client/TextureClient.cpp
@@ +693,5 @@
>                                  TextureFlags aTextureFlags,
>                                  TextureAllocationFlags aAllocFlags)
>  {
> +  // also test the validity of aAllocator
> +  MOZ_ASSERT(aAllocator ? aAllocator->IPCOpen() : false);

Same here:
MOZ_ASSERT(aAllocator && aAllocator->IPCOpen()).

By the way if you're going to suggest exactly the same patch in different places, it's easier to combine them into one patch.
Attachment #8696442 - Flags: review?(roc) → review+
Attached patch Bug 1230911.diffSplinter Review
Attachment #8696442 - Attachment is obsolete: true
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/18069b9f03e1
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla46
Duplicate of this bug: 1230912
You need to log in before you can comment on or make changes to this bug.