xserver-multidpi/dix
Aaron Plattner 8329afa59d dix: Reinstate GetImage window size check
Commit 587c3a2d19 fixed DoGetImage to
check windows against their backing drawables, rather than against the
screen dimensions, to prevent reading outside the bounds of redirected
windows' backing pixmaps (see bug #22804).  Unfortunately, while
making that change I also removed the check that the rectangle is
contained within the bounds of the source window, which is a violation
of the specification:

    If the drawable is a window, the window must be viewable, and it
    must be the case that, if there were no inferiors or overlapping
    windows, the specified rectangle of the window would be fully
    visible on the screen *and wholly contained within the outside
    edges of the window* (or a Match error results). Note that the
    borders of the window can be included and read with this request.

    (emphasis mine)

Reinstate the window dimension check, to return BadMatch if the
GetImage request falls outside the bounds of the window.

Fixes X Test Suite test XGetImage-15:

    400|0 15 1 11:05:41|IC Start
    200|0 15 11:05:41|TP Start
    520|0 15 00005146 1 1|VSW5TESTSUITE PURPOSE 15
    520|0 15 00005146 1 2|Assertion XGetImage-15.(A)
    520|0 15 00005146 1 3|When the drawable is a window and the window is viewable
    520|0 15 00005146 1 4|and it is not the case that given there were no inferiors or
    520|0 15 00005146 1 5|overlapping windows the specified rectangle of the window
    520|0 15 00005146 1 6|would be fully visible on the screen and wholly contained
    520|0 15 00005146 1 7|within the outside edges of the window, then a BadMatch
    520|0 15 00005146 1 8|error occurs.
    520|0 15 00005146 1 9|METH: Create window which is not fully visible on the screen.
    520|0 15 00005146 1 10|METH: Call XMapWindow to make sure the window is viewable.
    520|0 15 00005146 1 11|METH: Call XGetImage with rectangle extending beyond edge of screen.
    520|0 15 00005146 1 12|METH: Verify XGetImage return value is null.
    520|0 15 00005146 1 13|METH: Verify that BadMatch error occurred.
    520|0 15 00005146 1 14|METH: Create window which is fully visible on the screen.
    520|0 15 00005146 1 15|METH: Call XMapWindow to make sure the window is viewable.
    520|0 15 00005146 1 16|METH: Call XGetImage with rectangle extending beyond edge of window.
    520|0 15 00005146 1 17|METH: Verify XGetImage return value is null.
    520|0 15 00005146 1 18|METH: Verify that BadMatch error occurred.
    520|0 15 00005146 1 19|REPORT: Got Success, Expecting BadMatch
    520|0 15 00005146 1 20|REPORT: Null image not returned.
    220|0 15 1 11:05:41|FAIL

Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2011-10-31 15:42:11 -07:00
..
.gitignore dix and os: gitignore dix.O and os.O 2011-09-23 17:14:47 -07:00
atom.c Misc coding style cleanup 2010-05-13 06:16:48 +07:00
buildatoms XFree86 4.3.0.1 2003-11-14 16:49:22 +00:00
BuiltInAtoms R6.6 is the Xorg base-line 2003-11-14 15:54:54 +00:00
colormap.c Revert "Bug #6924: Restore the ABI for DrawableRec and ColormapRec to the state" 2011-09-19 22:31:21 -07:00
cursor.c Eliminate MAXSCREENS-sized CursorScreenKey array. 2011-09-19 22:53:05 -07:00
devices.c dix: block signals when closing all devices 2011-10-31 09:39:04 +10:00
dispatch.c dix: Reinstate GetImage window size check 2011-10-31 15:42:11 -07:00
dispatch.h xserver: delete pervasively use of DISPATCH_PROC 2010-09-28 16:45:05 +03:00
dixfonts.c dixfonts: Don't overwrite local c variable until new_closure is safely initialized. 2011-10-04 19:43:52 -07:00
dixutils.c dix: avoid calling deleted block and wakeup handlers 2011-06-30 16:38:29 +10:00
enterleave.c Use GetCurrentRootWindow or equivalent instead of spriteTrace[0]. 2010-10-13 15:58:12 +10:00
enterleave.h dix: call SetFocusOut and LeaveWindow when disabling a device. 2009-08-03 10:11:48 +10:00
eventconvert.c Use new FP1616/FP3232 conversion functions 2011-10-25 14:06:41 +10:00
events.c Move pointOnScreen to inpututils.c 2011-10-04 13:01:33 +10:00
extension.c dix: fix memory leak in ProcListExtensions 2011-04-04 15:47:58 +03:00
ffs.c Rework symbol visibility for easier maintenance 2008-12-03 05:43:34 -02:00
gc.c Un-export CreateScratchGC now that nothing external uses it. 2010-09-13 15:58:08 -07:00
getevents.c dix: accept a NULL master for CreateClassesChangedEvent 2011-10-25 14:06:41 +10:00
globals.c dix: delete logo hack screen saver 2010-11-11 23:20:35 +02:00
glyphcurs.c Replace dixChangeGC with calls directly to the right variant. 2010-05-13 17:14:07 -07:00
grabs.c dix: ignore devices when adding passive core grabs to list (#39545) 2011-08-22 15:56:50 +10:00
initatoms.c Rework symbol visibility for easier maintenance 2008-12-03 05:43:34 -02:00
inpututils.c input: switch InputOption to use XF86OptionRec storage. 2011-10-25 14:06:39 +10:00
main.c Terminate the log with one last message. 2011-07-27 09:31:02 +10:00
Makefile.am Don't use empty source files 2011-06-23 05:28:31 -07:00
pixmap.c Change the devPrivates API to require dixRegisterPrivateKey 2010-06-05 19:23:03 -07:00
privates.c Add fence sync driver interface 2010-12-06 19:15:26 -08:00
property.c DIX: Reset window properties when freeing them 2010-12-31 12:52:50 +00:00
protocol.txt Add DRI2 requests to protocol.txt 2009-08-28 23:29:05 -04:00
ptrveloc.c dix: move #if statement to stop compiler warning 2011-10-25 14:06:41 +10:00
region.c Delete RegionClipSpans() 2011-03-01 07:58:06 -05:00
registry.c Replace X-allocation functions with their C89 counterparts 2010-05-13 00:22:37 +07:00
resource.c dix: silence compiler warning 2011-04-21 13:43:46 +10:00
selection.c Fix property and selection devPrivate allocation. 2010-09-10 11:44:12 -07:00
swaprep.c Cast char* buffers to swap functions 2011-09-21 17:14:44 -04:00
swapreq.c Use internal temp variable for swap macros 2011-09-21 17:12:04 -04:00
tables.c dix: remove proc tables initialization 2010-09-28 16:46:46 +03:00
window.c Fix non-Composite builds in PrintWindowTree 2011-07-15 15:44:06 +10:00
Xserver-dtrace.h.in Sun's copyrights now belong to Oracle 2010-12-07 11:10:35 -08:00
Xserver.d Sun's copyrights now belong to Oracle 2010-12-07 11:10:35 -08:00