Skip ImageCanvasUtil copyPixels if sourceRect width/height <= 0 (fixes #521)

This commit is contained in:
Joshua Granick
2015-08-25 11:25:46 -07:00
parent 497a4c548b
commit 0324b54d3a

View File

@@ -88,7 +88,7 @@ class ImageCanvasUtil {
public static function copyPixels (image:Image, sourceImage:Image, sourceRect:Rectangle, destPoint:Vector2, alphaImage:Image = null, alphaPoint:Vector2 = null, mergeAlpha:Bool = false):Void {
if (destPoint.x >= image.width || destPoint.y >= image.height) {
if (destPoint == null || destPoint.x >= image.width || destPoint.y >= image.height || sourceRect == null || sourceRect.width <= 0 || sourceRect.height <= 0) {
return;