[Renderscript] Add check for Allocation.copyTo(Array) and
Fix the input allocation type check for Histogram Intrinsic. Bug: 19035242 Change-Id: I0ef2672bf816854db90fc92dc9ef51d1d231c246
This commit is contained in:
@@ -1262,6 +1262,10 @@ public class Allocation extends BaseObj {
|
||||
|
||||
private void copyTo(Object array, Element.DataType dt, int arrayLen) {
|
||||
Trace.traceBegin(RenderScript.TRACE_TAG, "copyTo");
|
||||
if (dt.mSize * arrayLen < mSize) {
|
||||
throw new RSIllegalArgumentException(
|
||||
"Size of output array cannot be smaller than size of allocation.");
|
||||
}
|
||||
mRS.validate();
|
||||
mRS.nAllocationRead(getID(mRS), array, dt);
|
||||
Trace.traceEnd(RenderScript.TRACE_TAG);
|
||||
|
||||
Reference in New Issue
Block a user