Skip to content
This repository has been archived by the owner on Mar 16, 2021. It is now read-only.

BUGFIX: EXC_BAD_ACCESS during CGContextDrawImage #46

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

alexappsnet
Copy link

Why it happened? In my case the image was 500 pixels width but:

NSUInteger width = 500
NSUInteger bytesPerPixel = 4
NSUInteger bytesPerRow = 2016

Because the image took 2016 bytes per row instead of 2000 we need
to allocate more memory for the "imageData" array.

Why it happened? In my case the image was 500 pixels width but:

  NSUInteger width = 500
  NSUInteger bytesPerPixel = 4
  NSUInteger bytesPerRow = 2016

Because the image took 2016 bytes per row instead of 2000 we need
to allocate more memory for the "imageData" array.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant