Add check for input allocation type for ScriptIntrinsicBlur.

Bug: 124466617
Test: mm
Test: CtsRenderscriptTestCases
Change-Id: I4784b96b5f96749d503bd1de8360e74b72f3f5c2
This commit is contained in:
Miao Wang
2019-03-06 12:33:51 -08:00
parent f2f31c212b
commit 08d7d0398e

View File

@@ -62,6 +62,10 @@ public final class ScriptIntrinsicBlur extends ScriptIntrinsic {
if (ain.getType().getY() == 0) {
throw new RSIllegalArgumentException("Input set to a 1D Allocation");
}
Element e = ain.getElement();
if ((!e.isCompatible(Element.U8_4(mRS))) && (!e.isCompatible(Element.U8(mRS)))) {
throw new RSIllegalArgumentException("Unsupported element type.");
}
mInput = ain;
setVar(1, ain);
}