Fixed bug #66356 (Heap Overflow Vulnerability in imagecrop())

Initial fix was PHP stuff
This one is libgd fix.

- filter invalid crop size
- dont try to copy on invalid position
- fix crop size when out of src image
- fix possible NULL deref
- fix possible integer overfloow
Merge branch 'PHP-5.5' into PHP-5.6

* PHP-5.5:
  Fixed bug #66356 (Heap Overflow Vulnerability in imagecrop())
Merge branch 'PHP-5.6'

* PHP-5.6:
  Fixed bug #66356 (Heap Overflow Vulnerability in imagecrop())
minor fix on previous
Merge branch 'PHP-5.5' into PHP-5.6

* PHP-5.5:
  minor fix on previous
Merge branch 'PHP-5.6'

* PHP-5.6:
  minor fix on previous