Closed
Bug 243763
Opened 20 years ago
Closed 11 years ago
warning C4244: '=' : conversion from 'LONG' to 'PRInt8', possible loss of data
Categories
(Core :: Graphics: ImageLib, defect, P5)
Tracking
()
RESOLVED
FIXED
mozilla21
People
(Reporter: timeless, Assigned: filidautore)
References
(Blocks 1 open bug, )
Details
(Whiteboard: [build_warning])
Attachments
(1 file, 1 obsolete file)
2.66 KB,
patch
|
bbondy
:
review+
|
Details | Diff | Splinter Review |
r:/mozilla\modules\libpr0n\decoders\icon\win\nsIconChannel.cpp(307) : warning C4244: '=' : conversion from 'LONG' to 'PRInt8', possible loss of data r:/mozilla\modules\libpr0n\decoders\icon\win\nsIconChannel.cpp(308) : warning C4244: '=' : conversion from 'LONG' to 'PRInt8', possible loss of data
Comment 1•20 years ago
|
||
Because of the API used we know that the icon can't have dimensions out of bounds, right? So we just need to shut up the compiler?
Status: UNCONFIRMED → NEW
Ever confirmed: true
Priority: -- → P5
Updated•15 years ago
|
QA Contact: imagelib
Updated•13 years ago
|
Whiteboard: [build_warning]
Updated•13 years ago
|
Blocks: buildwarning
Comment 2•13 years ago
|
||
Still an issue, though the code has moved: e:/builds/moz2_slave/m-cen-w32/build/image/decoders/icon/win/nsIconChannel.cpp(561) : warning C4244: '=' : conversion from 'LONG' to 'PRInt8', possible loss of data e:/builds/moz2_slave/m-cen-w32/build/image/decoders/icon/win/nsIconChannel.cpp(562) : warning C4244: '=' : conversion from 'LONG' to 'PRInt8', possible loss of data
Assignee | ||
Comment 3•11 years ago
|
||
I only made the cast explicit.
Attachment #699195 -
Flags: review?(joe)
Comment 4•11 years ago
|
||
Comment on attachment 699195 [details] [diff] [review] Make the cast explicit Review of attachment 699195 [details] [diff] [review]: ----------------------------------------------------------------- While this code looks great, I don't know enough about GetDIBits to comment on whether it's actually not going to overflow - i.e., whether we have a latent bug here.
Attachment #699195 -
Flags: review?(joe) → review?(netzen)
Comment 5•11 years ago
|
||
(In reply to Joe Drew from comment #4) > While this code looks great, I don't know enough about GetDIBits to comment > on whether it's actually not going to overflow - i.e., whether we have a > latent bug here. Seems legit, the bitmap came from an HICON in the first place.
Comment 6•11 years ago
|
||
Comment on attachment 699195 [details] [diff] [review] Make the cast explicit Review of attachment 699195 [details] [diff] [review]: ----------------------------------------------------------------- Thanks for the patch! I think GetIconInfo will always return handles to bitmaps that have the correct dimensions but we might as well add some sanity checks while we're here. Could you add some extra checks here: http://dxr.mozilla.org/mozilla-central/image/decoders/icon/win/nsIconChannel.cpp.html#l489 colorHeader.biWidth >= 0 && colorHeader.biWidth <= 255 && colorHeader.biHeight >= 0 && colorHeader.biHeight <= 255 && Re-request review after that and we should be good to land this patch.
Updated•11 years ago
|
Attachment #699195 -
Flags: review?(netzen) → feedback+
Assignee | ||
Comment 7•11 years ago
|
||
Attachment #700283 -
Flags: review?(netzen)
Comment 8•11 years ago
|
||
Comment on attachment 700283 [details] [diff] [review] Make the cast explicit, plus feedback Review of attachment 700283 [details] [diff] [review]: ----------------------------------------------------------------- Looks good, I'll run it through try and if it passes we can land it! Thanks again for the patch.
Attachment #700283 -
Flags: review?(netzen) → review+
Updated•11 years ago
|
Attachment #699195 -
Attachment is obsolete: true
Comment 9•11 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/9c2be62cb0c0
Target Milestone: --- → mozilla21
Comment 10•11 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/9c2be62cb0c0
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Updated•11 years ago
|
Assignee: neil → filidautore
You need to log in
before you can comment on or make changes to this bug.
Description
•