Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Robot.createScreenCapture VM crash



there's missing bounds checking on the Rectangle you pass to Robot.createScreenCapture. grab off the left of the display, and you get pixels from the right. grab off the bottom, and you get non-display memory. grab off the top, and you get EXC_BAD_ACCESS:

0   <<00000000>>     0xffff8a2c __memcpy + 652 (cpu_capabilities.h:189)
1   libawt.jnilib                0x9df0ad30 screenSrcGetBytes + 84
2   com.apple.CoreGraphics       0x903c540c CGAccessSessionGetChunks + 508
3   com.apple.CoreGraphics       0x9044f35c img_decode_read + 408
4   com.apple.CoreGraphics       0x903c3d68 img_data_lock + 3684
5   com.apple.CoreGraphics       0x903c27d8 CGSImageDataLockWithReference + 156
6   libRIP.A.dylib               0x945d7ad8 ripc_AcquireImage + 904
7   libRIP.A.dylib               0x945d6260 ripc_DrawImage + 2324
8   com.apple.CoreGraphics       0x903c2568 CGContextDelegateDrawImage + 76
9   com.apple.CoreGraphics       0x903c24d0 CGContextDrawImage + 340
10  libawt.jnilib                0x9df0afcc Java_apple_awt_CRobot_getScreenPixels + 560

bug report with example code and instructions to reproduce thrown into the "Send to Apple..." void.

i thought i'd let others on the list know.

the obvious "so don't do that" work-around works, though y-coordinate 0 appears to be half way down the screen menu bar, so maybe there's some coordinate translation missing too? (all i know about CoreGraphics i learned from otool -tvV on other programs; i've never actually used it.)

-- 

Elliott Hughes, http://www.jessies.org/~enh/


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Java-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/java-dev/email@hidden

This email sent to email@hidden



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.