Fixed #1668 CGContextDrawImage: invalid context 0x0

This commit is contained in:
Bogdan Poplauschi 2016-10-06 16:54:17 +03:00
parent 5e90081b69
commit b366d84f93
1 changed files with 4 additions and 1 deletions

View File

@ -41,6 +41,9 @@ static const size_t kBitsPerComponent = 8;
bytesPerRow,
colorspaceRef,
kCGBitmapByteOrderDefault|kCGImageAlphaNoneSkipLast);
if (context == NULL) {
return image;
}
// Draw the image into the context and retrieve the new bitmap image without alpha
CGContextDrawImage(context, CGRectMake(0, 0, width, height), imageRef);
@ -130,7 +133,7 @@ static const CGFloat kDestSeemOverlap = 2.0f; // the numbers of pixels to over
kCGBitmapByteOrderDefault|kCGImageAlphaNoneSkipLast);
if (destContext == NULL) {
free( destBitmapData );
free(destBitmapData);
return image;
}
CGContextSetInterpolationQuality(destContext, kCGInterpolationHigh);