• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
NSImage, corrupt images and address faults
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

References: 
 >NSImage,NSImageView, display and address faults (From: Dan Grassi <email@hidden>)

  • Prev by Date: Re: NSTextView to HTML
  • Next by Date: Re: Toll Free Bridging, wrapping the SearchKit, and One-Way Bridging
  • Previous by thread: NSImage,NSImageView, display and address faults
  • Next by thread: Re: NSImage, corrupt images and address faults
  • Index(es):
    • Date
    • Thread