Closed
Bug 1293940
Opened 9 years ago
Closed 9 years ago
[Coverity #749800][Uninitialized members] /dom/media/MediaCache.cpp: 280 in mozilla::MediaCache::BlockOwner::BlockOwner()()
Categories
(Core :: Audio/Video: Playback, defect)
Core
Audio/Video: Playback
Tracking
()
RESOLVED
FIXED
mozilla51
| Tracking | Status | |
|---|---|---|
| firefox51 | --- | fixed |
People
(Reporter: jwwang, Assigned: jwwang)
Details
Attachments
(1 file)
*** CID 749800: Uninitialized members (UNINIT_CTOR)
/dom/media/MediaCache.cpp: 280 in mozilla::MediaCache::BlockOwner::BlockOwner()()
274 // offset is greater than or equal to the stream's current
275 // reader position
276 READAHEAD_BLOCK
277 };
278
279 struct BlockOwner {
>>> CID 749800: Uninitialized members (UNINIT_CTOR)
>>> Non-static class member "mStreamBlock" is not initialized in this constructor nor in any functions that it calls.
280 BlockOwner() : mStream(nullptr), mClass(READAHEAD_BLOCK) {}
281
282 // The stream that owns this block, or null if the block is free.
283 MediaCacheStream* mStream;
284 // The block index in the stream. Valid only if mStream is non-null.
285 uint32_t mStreamBlock;
| Assignee | ||
Updated•9 years ago
|
Assignee: nobody → jwwang
I've already marked it as "intentional" on Coverity's website, as I thought it was not a problem.
Of course, it would be easy to just initialize it to 0 for peace of mind, up to you.
| Assignee | ||
Comment 2•9 years ago
|
||
Thanks! I still want to initialize them so it won't bother any other static analysis tools.
| Comment hidden (mozreview-request) |
| Comment hidden (mozreview-request) |
| Assignee | ||
Updated•9 years ago
|
Attachment #8779643 -
Flags: review?(gsquelart)
Comment 5•9 years ago
|
||
| mozreview-review | ||
Comment on attachment 8779643 [details]
Bug 1293940 - fix uninitialized members.
https://reviewboard.mozilla.org/r/70618/#review68212
r+ with nit:
::: dom/media/MediaCache.cpp:285
(Diff revision 2)
> - BlockOwner() : mStream(nullptr), mClass(READAHEAD_BLOCK) {}
> + constexpr BlockOwner() {}
>
> // The stream that owns this block, or null if the block is free.
> - MediaCacheStream* mStream;
> + MediaCacheStream* mStream = nullptr;
> // The block index in the stream. Valid only if mStream is non-null.
> - uint32_t mStreamBlock;
> + // Initialized to an insane value to prevent misuse.
Strictly speaking, this won't *prevent* misuse.
How about "to highlight misuses" or similar?
Attachment #8779643 -
Flags: review?(gsquelart) → review+
| Assignee | ||
Comment 6•9 years ago
|
||
| mozreview-review-reply | ||
Comment on attachment 8779643 [details]
Bug 1293940 - fix uninitialized members.
https://reviewboard.mozilla.org/r/70618/#review68212
> Strictly speaking, this won't *prevent* misuse.
> How about "to highlight misuses" or similar?
Yeah, thanks for the suggestion!
| Comment hidden (mozreview-request) |
Pushed by jwwang@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/d2c07e16630c
fix uninitialized members. r=gerald
Comment 9•9 years ago
|
||
| bugherder | ||
Status: NEW → RESOLVED
Closed: 9 years ago
status-firefox51:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla51
You need to log in
before you can comment on or make changes to this bug.
Description
•