Closed
Bug 282867
Opened 20 years ago
Closed 20 years ago
Should call ::GdiFlush before trying to read from a DIB section's memory
Categories
(Core Graveyard :: GFX: Win32, defect)
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: neil, Assigned: neil)
References
()
Details
Attachments
(1 file)
1.67 KB,
patch
|
emaijala+moz
:
review+
darin.moz
:
superreview+
|
Details | Diff | Splinter Review |
Because of the GDI batch limit it is possible for GDI writes to a DIB section to
have been uncompleted before you attempt to read the memory directly. I have
examined the win32 code and determined three locations where it appears that a
DIB section's memory might be read, and therefore GDI ought to be flushed first.
1. nsDrawingSurfaceWin::Lock might return the memory for mSelectedBitmap
2. nsImageWin::DrawComposited reads screenBits after setting them with BitBlt
3. nsImageWin::DrawTile reads screenBits after setting them with SretchBlt
Note that there is no issue with writing to a DIB section before calling a GDI
function, or passing DIB section raw memory buffers to GDI functions.
Assignee | ||
Comment 1•20 years ago
|
||
Assignee: win32 → neil.parkwaycc.co.uk
Status: NEW → ASSIGNED
Attachment #174997 -
Flags: superreview?(darin)
Attachment #174997 -
Flags: review?(emaijala)
Assignee | ||
Comment 2•20 years ago
|
||
Hmm... actually the docs suggest that you can't even call SetDIBits...
Comment 3•20 years ago
|
||
Comment on attachment 174997 [details] [diff] [review]
Proposed patch
I presume that you were not able to actually demonstrate the problem, correct?
Also, what is the default batch limit? It does not appear that we ever set the
batch limit.
Attachment #174997 -
Flags: superreview?(darin) → superreview+
Assignee | ||
Comment 4•20 years ago
|
||
The default batch limit appears to be 1 for Windows 9x/Me and 20 for NT class
operating systems, although NT often flushes the batch before the limit.
Assignee | ||
Comment 5•20 years ago
|
||
Oh, I was able to demonstrate case 2, which is what led me to file this bug.
Comment 6•20 years ago
|
||
ok, sounds good.
Comment 7•20 years ago
|
||
Comment on attachment 174997 [details] [diff] [review]
Proposed patch
r=emaijala on this good thing
Attachment #174997 -
Flags: review?(emaijala) → review+
Assignee | ||
Comment 8•20 years ago
|
||
Fix checked in.
Status: ASSIGNED → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
Updated•16 years ago
|
Product: Core → Core Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•