Closed
Bug 1228314
Opened 9 years ago
Closed 9 years ago
[Static Analysis][INT Overflow] Function LookupBestMatch from SurfaceCache.cpp overflow on idealArea
Categories
(Core :: Graphics: ImageLib, defect)
Core
Graphics: ImageLib
Tracking
()
RESOLVED
FIXED
mozilla47
People
(Reporter: andi, Assigned: andi)
References
(Blocks 1 open bug)
Details
(Keywords: coverity, Whiteboard: CID 1340239)
Attachments
(2 files)
1.11 KB,
patch
|
Details | Diff | Splinter Review | |
58 bytes,
text/x-review-board-request
|
seth
:
review+
lizzard
:
approval-mozilla-aurora+
|
Details |
The Static Analysis tool Scan-Build added that variable idealArea will be assigned a potentially overflow value from int32.
Assignee | ||
Comment 1•9 years ago
|
||
Hello Seth could you please take a look other this issue and tell me if the patch seems ok?
Flags: needinfo?(seth)
Assignee | ||
Updated•9 years ago
|
Whiteboard: CID 1340239
Assignee | ||
Comment 2•9 years ago
|
||
A correction to my first post the error was generated by Coverity not Scan-build
Assignee | ||
Comment 3•9 years ago
|
||
Review commit: https://reviewboard.mozilla.org/r/31241/diff/#index_header
See other reviews: https://reviewboard.mozilla.org/r/31241/
Attachment #8709049 -
Flags: review?(seth)
Assignee | ||
Updated•9 years ago
|
Flags: needinfo?(seth)
Assignee | ||
Updated•9 years ago
|
Attachment #8709049 -
Flags: review?(netzen)
Comment 4•9 years ago
|
||
Comment on attachment 8709049 [details]
MozReview Request: Bug 1228314 - added static_cast<int64> in order to avoid overflow. r?seth
Sorry, I am not ideal for this review.
Attachment #8709049 -
Flags: review?(netzen)
Updated•9 years ago
|
Attachment #8709049 -
Flags: review?(seth) → review+
Comment 5•9 years ago
|
||
Comment on attachment 8709049 [details]
MozReview Request: Bug 1228314 - added static_cast<int64> in order to avoid overflow. r?seth
https://reviewboard.mozilla.org/r/31241/#review33283
Looks good! Thanks for identifying this issue.
::: image/SurfaceCache.cpp:330
(Diff revision 1)
> - int64_t idealArea = idealKey.Size().width * idealKey.Size().height;
> + int64_t idealArea = static_cast<int64_t>(idealKey.Size().width) * static_cast<int64_t>(idealKey.Size().height);
This looks over 80 columns. Please insert a line break right after the '*'.
Assignee | ||
Comment 6•9 years ago
|
||
Comment on attachment 8709049 [details]
MozReview Request: Bug 1228314 - added static_cast<int64> in order to avoid overflow. r?seth
Review request updated; see interdiff: https://reviewboard.mozilla.org/r/31241/diff/1-2/
Comment 8•9 years ago
|
||
bugherder |
Status: NEW → RESOLVED
Closed: 9 years ago
status-firefox47:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla47
Comment 9•9 years ago
|
||
Comment on attachment 8709049 [details]
MozReview Request: Bug 1228314 - added static_cast<int64> in order to avoid overflow. r?seth
Need this for bug 1251091.
Approval Request Comment
[Feature/regressing bug #]: bug 1119774 added this code
[User impact if declined]: needed for bug 1251091
[Describe test coverage new/current, TreeHerder]: none
[Risks and why]: safe
[String/UUID change made/needed]: none
Attachment #8709049 -
Flags: approval-mozilla-aurora?
Comment 11•9 years ago
|
||
Comment on attachment 8709049 [details]
MozReview Request: Bug 1228314 - added static_cast<int64> in order to avoid overflow. r?seth
We need this for the other related fixes for surface issues
Please uplift to aurora.
Attachment #8709049 -
Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
Comment 12•9 years ago
|
||
bugherder uplift |
Updated•6 years ago
|
Blocks: coverity-analysis
You need to log in
before you can comment on or make changes to this bug.
Description
•