diff options
author | Alex Sakhartchouk <alexst@google.com> | 2012-02-02 14:56:34 -0800 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2012-02-02 14:56:34 -0800 |
commit | 98bea4a3ec6dfd0f5c6ec612b57b122f16f49b7f (patch) | |
tree | 877115f9e72c9e1c2ec0b45ff30f455cef0494c8 /libs/rs | |
parent | 8d1c18a181df7d141e8e341e8b120caf3717a506 (diff) | |
parent | 7042613c653fd0de253f2f659901318902fa4584 (diff) | |
download | frameworks_base-98bea4a3ec6dfd0f5c6ec612b57b122f16f49b7f.zip frameworks_base-98bea4a3ec6dfd0f5c6ec612b57b122f16f49b7f.tar.gz frameworks_base-98bea4a3ec6dfd0f5c6ec612b57b122f16f49b7f.tar.bz2 |
am 7042613c: Merge "Fix an incorrect assert that doesn\'t account for element array size."
* commit '7042613c653fd0de253f2f659901318902fa4584':
Fix an incorrect assert that doesn't account for element array size.
Diffstat (limited to 'libs/rs')
-rw-r--r-- | libs/rs/rsAllocation.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/libs/rs/rsAllocation.cpp b/libs/rs/rsAllocation.cpp index 1dc36b7..02c6809 100644 --- a/libs/rs/rsAllocation.cpp +++ b/libs/rs/rsAllocation.cpp @@ -125,7 +125,8 @@ void Allocation::elementData(Context *rsc, uint32_t x, const void *data, } const Element * e = mHal.state.type->getElement()->getField(cIdx); - if (sizeBytes != e->getSizeBytes()) { + uint32_t elemArraySize = mHal.state.type->getElement()->getFieldArraySize(cIdx); + if (sizeBytes != e->getSizeBytes() * elemArraySize) { ALOGE("Error Allocation::subElementData data size %zu does not match field size %zu.", sizeBytes, e->getSizeBytes()); rsc->setError(RS_ERROR_BAD_VALUE, "subElementData bad size."); return; @@ -158,8 +159,8 @@ void Allocation::elementData(Context *rsc, uint32_t x, uint32_t y, } const Element * e = mHal.state.type->getElement()->getField(cIdx); - - if (sizeBytes != e->getSizeBytes()) { + uint32_t elemArraySize = mHal.state.type->getElement()->getFieldArraySize(cIdx); + if (sizeBytes != e->getSizeBytes() * elemArraySize) { ALOGE("Error Allocation::subElementData data size %zu does not match field size %zu.", sizeBytes, e->getSizeBytes()); rsc->setError(RS_ERROR_BAD_VALUE, "subElementData bad size."); return; |