summaryrefslogtreecommitdiffstats
path: root/rs/java
diff options
context:
space:
mode:
authorAndreas Gampe <agampe@google.com>2015-03-18 22:18:25 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2015-03-18 22:18:26 +0000
commit8df1bedcba5bf146c49ba6b6a89e4f97c018045c (patch)
treedf39413f94731e0266dd56bbdf428d73904df2f7 /rs/java
parente2c8e504d143c42c25d7e61a18f50cccb80f0c4d (diff)
parentad555f91a0f95c6778a0e0f9a2a9cfd57dc00b6c (diff)
downloadframeworks_base-8df1bedcba5bf146c49ba6b6a89e4f97c018045c.zip
frameworks_base-8df1bedcba5bf146c49ba6b6a89e4f97c018045c.tar.gz
frameworks_base-8df1bedcba5bf146c49ba6b6a89e4f97c018045c.tar.bz2
Merge "Frameworks/base: Fix potential NPE in Script"
Diffstat (limited to 'rs/java')
-rw-r--r--rs/java/android/renderscript/Script.java11
1 files changed, 8 insertions, 3 deletions
diff --git a/rs/java/android/renderscript/Script.java b/rs/java/android/renderscript/Script.java
index 83aeedd..65056ac 100644
--- a/rs/java/android/renderscript/Script.java
+++ b/rs/java/android/renderscript/Script.java
@@ -251,9 +251,14 @@ public class Script extends BaseObj {
"At least one of ain or aout is required to be non-null.");
}
- long[] in_ids = new long[ains.length];
- for (int index = 0; index < ains.length; ++index) {
- in_ids[index] = ains[index].getID(mRS);
+ long[] in_ids;
+ if (ains != null) {
+ in_ids = new long[ains.length];
+ for (int index = 0; index < ains.length; ++index) {
+ in_ids[index] = ains[index].getID(mRS);
+ }
+ } else {
+ in_ids = null;
}
long out_id = 0;