Closed
Bug 1414709
Opened 7 years ago
Closed 7 years ago
Use Span<> to replace low level pointer arithmetic in MediaCacheStream::NotifyDataReceived()
Categories
(Core :: Audio/Video: Playback, defect, P3)
Core
Audio/Video: Playback
Tracking
()
RESOLVED
FIXED
mozilla58
Tracking | Status | |
---|---|---|
firefox58 | --- | fixed |
People
(Reporter: jwwang, Assigned: jwwang)
References
(Blocks 1 open bug)
Details
Attachments
(1 file)
No description provided.
Assignee | ||
Updated•7 years ago
|
Comment hidden (mozreview-request) |
Assignee | ||
Updated•7 years ago
|
Attachment #8925411 -
Flags: review?(bechen)
Comment 2•7 years ago
|
||
mozreview-review |
Comment on attachment 8925411 [details] Bug 1414709 - use Span<> to replace low level pointer arithmetic in MediaCacheStream::NotifyDataReceived(). https://reviewboard.mozilla.org/r/196532/#review201746
Attachment #8925411 -
Flags: review?(bechen) → review+
Assignee | ||
Updated•7 years ago
|
Attachment #8925411 -
Flags: review?(gsquelart)
Comment 3•7 years ago
|
||
mozreview-review |
Comment on attachment 8925411 [details] Bug 1414709 - use Span<> to replace low level pointer arithmetic in MediaCacheStream::NotifyDataReceived(). https://reviewboard.mozilla.org/r/196532/#review201766 ::: dom/media/ChannelMediaResource.cpp:443 (Diff revision 1) > { > Closure* closure = static_cast<Closure*>(aClosure); > closure->mResource->mCacheStream.NotifyDataReceived( > - closure->mLoadID, aCount, aFromSegment); > + closure->mLoadID, > + aCount, > + reinterpret_cast<const unsigned char*>(aFromSegment)); 'unsigned char' -> 'uint8_t', to match the NotifyDataReceived argument.
Attachment #8925411 -
Flags: review?(gsquelart) → review+
Assignee | ||
Comment 4•7 years ago
|
||
mozreview-review-reply |
Comment on attachment 8925411 [details] Bug 1414709 - use Span<> to replace low level pointer arithmetic in MediaCacheStream::NotifyDataReceived(). https://reviewboard.mozilla.org/r/196532/#review201766 > 'unsigned char' -> 'uint8_t', to match the NotifyDataReceived argument. That was done intentionally. AFAIK, uint8_t doesn't always equal 'unsigned char' on all platforms and casting char* to uint8_t* will break strict aliasing if sizeof(uint8_t) != sizeof(char).
Assignee | ||
Comment 5•7 years ago
|
||
I guess strict aliasing is not an issue here since we never dereference |aData|.
Comment 6•7 years ago
|
||
mozreview-review-reply |
Comment on attachment 8925411 [details] Bug 1414709 - use Span<> to replace low level pointer arithmetic in MediaCacheStream::NotifyDataReceived(). https://reviewboard.mozilla.org/r/196532/#review201766 > That was done intentionally. AFAIK, uint8_t doesn't always equal 'unsigned char' on all platforms and casting char* to uint8_t* will break strict aliasing if sizeof(uint8_t) != sizeof(char). I thought aliasing between any type and `char` was supported? And then you call a function that takes `const uint8_t*`, so there's still a potential cast from `const unsigned char*` to `const uint8_t*` (if they are in fact different).
Comment hidden (mozreview-request) |
Assignee | ||
Comment 8•7 years ago
|
||
Thanks for the reviews!
Pushed by jwwang@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/5915590f9500 use Span<> to replace low level pointer arithmetic in MediaCacheStream::NotifyDataReceived(). r=bechen,gerald
Comment 10•7 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/5915590f9500
Status: NEW → RESOLVED
Closed: 7 years ago
status-firefox58:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla58
You need to log in
before you can comment on or make changes to this bug.
Description
•