diff options
author | Miao Wang <miaowang@google.com> | 2016-04-24 15:41:12 -0700 |
---|---|---|
committer | Miao Wang <miaowang@google.com> | 2016-04-24 16:18:34 -0700 |
commit | 6b855bd97cc9294e86abdb5e50733fc32cca25e4 (patch) | |
tree | 3596e68b85a1366a9608d6a03cdb15fd3087e2e7 /driver | |
parent | 633beab5de5ffe4c5068cf1c7a1c0bd09ee9f195 (diff) | |
download | rs-6b855bd97cc9294e86abdb5e50733fc32cca25e4.tar.gz |
Fix copyFrom for YUV Allocation.
Bug: 28249238
- When copying data into YUV Allocation, src pointer was moving
incorrectly. It should move by the number of bytes copied, rather
than the stride of the destination LOD of the Allocation.
Change-Id: I721856d6ee23f7f3b1ec58ac5ad26f118febac4a
Diffstat (limited to 'driver')
-rw-r--r-- | driver/rsdAllocation.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/driver/rsdAllocation.cpp b/driver/rsdAllocation.cpp index a3203a7e..3816c239 100644 --- a/driver/rsdAllocation.cpp +++ b/driver/rsdAllocation.cpp @@ -934,7 +934,9 @@ void rsdAllocationData2D(const Context *rsc, const Allocation *alloc, for (uint32_t line=(yoff >> 1); line < ((yoff+h)>>1); line++) { memcpy(dst, src, clineSize); - src += alloc->mHal.drvState.lod[lod].stride; + // When copying from an array to an Allocation, the src pointer + // to the array should just move by the number of bytes copied. + src += clineSize; dst += alloc->mHal.drvState.lod[lod].stride; } lod++; |