ADC Home > Reference Library > Technical Q&As > Legacy Documents > Mac OS 9 & Earlier >

Legacy Documentclose button

Important: This document is part of the Legacy section of the ADC Reference Library. This information should not be used for new development.

Current information on this Reference Library topic can be found here:

NOTE: This Technical Q&A has been retired. Please see the Technical Q&As page for current documentation.

Copybits Bus Error with Offscreen GWorld


Q: I'm attempting to CopyBits an image from a window to an offscreen GWorld, and I'm getting a Bus Error on some machines but not others.

A: Your window is partially off the bottom of the screen, and CopyBits is attempting to read pixels below the bottom of the PixMap. In some cases, the access is going beyond the video RAM into unmapped memory space, causing a Bus Error.

Native QuickDraw fixes this problem by comparing the source rectangle to the source PixMap's bounds rect, but most 68K versions of QuickDraw do not check the source rectangle. For best results, constrain your source rectangle to the limits of the screen. Note that you can't always rely on the window having useful information, since it might be obscured by other windows, or it might have been written to by another piece of code (e.g., games that write directly to the screen, extensions, etc).

[Nov 17 1997]


Did this document help you?
Yes: Tell us what works for you.
It’s good, but: Report typos, inaccuracies, and so forth.
It wasn’t helpful: Tell us what would have helped.