NSImage, corrupt images and address faults
NSImage, corrupt images and address faults
- Subject: NSImage, corrupt images and address faults
- From: Dan Grassi <email@hidden>
- Date: Thu, 4 Dec 2003 01:08:54 -0500
OS X 10.3.1 in a ObjC++ (.mm) code file
I have a problem with NSImage and corrupt images. I call [image
isValad] and it returns YES. But I get a log message in the debugger:
Corrupt JPEG data: 962 extraneous bytes before marker 0xd9
So obviously NSImage knows that the image is _not_ valid.
Is there a way to get this message? If so I can skip rendering the
image. Or perhaps that is to late.
The real problem comes when NSImage is released:
Program received signal: "EXC_BAD_ACCESS".
The call tree is from the debugger (last call last):
-[NSImage dealloc]
-[NsImage _freeRepresentation:]
-[NSImage cachedImageRep dealloc]
_NXFreeCache
objc_msgSend_stret
Apple's Preview application on occasion also crashes on the same
corrupt images.
And my program crashes. Basically this is unacceptable but I am at a
loss to figure out how to avoid it.
I check the header with custom code to weed out obviously bad images
but I can't catch all of them.
Can I catch signals?
Dan
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.