Closed Bug 285048 Opened 19 years ago Closed 19 years ago

nsImageWin::ConvertDDBtoDIB uses wrong color depth

Categories

(Core Graveyard :: GFX: Win32, defect, P2)

x86
Windows XP
defect

Tracking

(Not tracked)

RESOLVED FIXED
mozilla1.8beta2

People

(Reporter: Biesinger, Assigned: Biesinger)

References

Details

Attachments

(1 file)

ConvertDDBtoDIB passes the color depth of the DDB to BuildDIB. That's wrong -
callers of nsImageWin::GetBits expect the color depth to be whatever nsImageWin
currently uses (24bpp, usually). So, this function should pass mNumBytesPixel*8
to BuildDIB.
Attached patch patchSplinter Review
Attachment #176515 - Flags: review?(emaijala)
Status: NEW → ASSIGNED
Target Milestone: --- → mozilla1.8beta2
Priority: -- → P2
Comment on attachment 176515 [details] [diff] [review]
patch

If mNumBytesPixel is bytes as the name implies, you shouldn't multiply it. If
it's actually bits, please fix the variable name.
Attachment #176515 - Flags: review?(emaijala) → review-
Comment on attachment 176515 [details] [diff] [review]
patch

mNumBytesPixel is what it says; but I still need to multiply it, since BuildDIB
expects bits per pixel, not bytes...
Attachment #176515 - Flags: review- → review?(emaijala)
Comment on attachment 176515 [details] [diff] [review]
patch

Sorry, you're right :/

Note to self: don't do reviews early in the morning.
Attachment #176515 - Flags: review?(emaijala) → review+
Attachment #176515 - Flags: superreview?(roc)
Attachment #176515 - Flags: superreview?(roc) → superreview+
Blocks: 286236
Checking in gfx/src/windows/nsImageWin.cpp;
/cvsroot/mozilla/gfx/src/windows/nsImageWin.cpp,v  <--  nsImageWin.cpp
new revision: 3.142; previous revision: 3.141
done
Status: ASSIGNED → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: