Bug fix: AllocationData3D & AllocationRead3D cannot handle z sections
correctly. (use count 'd' where 'd + zoff' should be used)

Change-Id: Ib3064fd8be78e85b06df033a118619ad3a4e163f
diff --git a/driver/rsdAllocation.cpp b/driver/rsdAllocation.cpp
index 3af04b0..eabdf06 100644
--- a/driver/rsdAllocation.cpp
+++ b/driver/rsdAllocation.cpp
@@ -930,7 +930,7 @@
 
     if (alloc->mHal.drvState.lod[0].mallocPtr) {
         const uint8_t *src = static_cast<const uint8_t *>(data);
-        for (uint32_t z = zoff; z < d; z++) {
+        for (uint32_t z = zoff; z < (d + zoff); z++) {
             uint8_t *dst = GetOffsetPtr(alloc, xoff, yoff, z, lod,
                                         RS_ALLOCATION_CUBEMAP_FACE_POSITIVE_X);
             if (dst == src) {
@@ -1007,7 +1007,7 @@
 
     if (alloc->mHal.drvState.lod[0].mallocPtr) {
         uint8_t *dst = static_cast<uint8_t *>(data);
-        for (uint32_t z = zoff; z < d; z++) {
+        for (uint32_t z = zoff; z < (d + zoff); z++) {
             const uint8_t *src = GetOffsetPtr(alloc, xoff, yoff, z, lod,
                                               RS_ALLOCATION_CUBEMAP_FACE_POSITIVE_X);
             if (dst == src) {