Fix a bug in the extents of an intersection. Add some checks and assert that helps when using the remoteFx encoder. A speedup for intersection when bands are above the target rect.
Replaced zmalloc by calloc. Moved region from utils to codec. Fixed some typo and corner cases.