Loading graphics/java/android/renderscript/FieldPacker.java +5 −1 Original line number Diff line number Diff line Loading @@ -76,6 +76,7 @@ public class FieldPacker { public void addU8(short v) { if ((v < 0) || (v > 0xff)) { android.util.Log.e("rs", "FieldPacker.addU8( " + v + " )"); throw new IllegalArgumentException("Saving value out of range for type"); } mData[mPos++] = (byte)v; Loading @@ -83,6 +84,7 @@ public class FieldPacker { public void addU16(int v) { if ((v < 0) || (v > 0xffff)) { android.util.Log.e("rs", "FieldPacker.addU16( " + v + " )"); throw new IllegalArgumentException("Saving value out of range for type"); } align(2); Loading @@ -91,7 +93,8 @@ public class FieldPacker { } public void addU32(long v) { if ((v < 0) || (v > 0xffffffff)) { if ((v < 0) || (v > 0xffffffffL)) { android.util.Log.e("rs", "FieldPacker.addU32( " + v + " )"); throw new IllegalArgumentException("Saving value out of range for type"); } align(4); Loading @@ -103,6 +106,7 @@ public class FieldPacker { public void addU64(long v) { if (v < 0) { android.util.Log.e("rs", "FieldPacker.addU64( " + v + " )"); throw new IllegalArgumentException("Saving value out of range for type"); } align(8); Loading libs/rs/rsAllocation.cpp +3 −0 Original line number Diff line number Diff line Loading @@ -34,6 +34,9 @@ Allocation::Allocation(Context *rsc, const Type *type) : ObjectBase(rsc) init(rsc, type); mPtr = malloc(mType->getSizeBytes()); if (mType->getElement()->getHasReferences()) { memset(mPtr, 0, mType->getSizeBytes()); } if (!mPtr) { LOGE("Allocation::Allocation, alloc failure"); } Loading libs/rs/rsElement.cpp +2 −2 Original line number Diff line number Diff line Loading @@ -266,7 +266,7 @@ void Element::incRefs(const void *ptr) const if (mComponent.isReference()) { ObjectBase *const*obp = static_cast<ObjectBase *const*>(ptr); ObjectBase *ob = obp[0]; ob->incSysRef(); if (ob) ob->incSysRef(); } return; } Loading @@ -285,7 +285,7 @@ void Element::decRefs(const void *ptr) const if (mComponent.isReference()) { ObjectBase *const*obp = static_cast<ObjectBase *const*>(ptr); ObjectBase *ob = obp[0]; ob->decSysRef(); if (ob) ob->decSysRef(); } return; } Loading Loading
graphics/java/android/renderscript/FieldPacker.java +5 −1 Original line number Diff line number Diff line Loading @@ -76,6 +76,7 @@ public class FieldPacker { public void addU8(short v) { if ((v < 0) || (v > 0xff)) { android.util.Log.e("rs", "FieldPacker.addU8( " + v + " )"); throw new IllegalArgumentException("Saving value out of range for type"); } mData[mPos++] = (byte)v; Loading @@ -83,6 +84,7 @@ public class FieldPacker { public void addU16(int v) { if ((v < 0) || (v > 0xffff)) { android.util.Log.e("rs", "FieldPacker.addU16( " + v + " )"); throw new IllegalArgumentException("Saving value out of range for type"); } align(2); Loading @@ -91,7 +93,8 @@ public class FieldPacker { } public void addU32(long v) { if ((v < 0) || (v > 0xffffffff)) { if ((v < 0) || (v > 0xffffffffL)) { android.util.Log.e("rs", "FieldPacker.addU32( " + v + " )"); throw new IllegalArgumentException("Saving value out of range for type"); } align(4); Loading @@ -103,6 +106,7 @@ public class FieldPacker { public void addU64(long v) { if (v < 0) { android.util.Log.e("rs", "FieldPacker.addU64( " + v + " )"); throw new IllegalArgumentException("Saving value out of range for type"); } align(8); Loading
libs/rs/rsAllocation.cpp +3 −0 Original line number Diff line number Diff line Loading @@ -34,6 +34,9 @@ Allocation::Allocation(Context *rsc, const Type *type) : ObjectBase(rsc) init(rsc, type); mPtr = malloc(mType->getSizeBytes()); if (mType->getElement()->getHasReferences()) { memset(mPtr, 0, mType->getSizeBytes()); } if (!mPtr) { LOGE("Allocation::Allocation, alloc failure"); } Loading
libs/rs/rsElement.cpp +2 −2 Original line number Diff line number Diff line Loading @@ -266,7 +266,7 @@ void Element::incRefs(const void *ptr) const if (mComponent.isReference()) { ObjectBase *const*obp = static_cast<ObjectBase *const*>(ptr); ObjectBase *ob = obp[0]; ob->incSysRef(); if (ob) ob->incSysRef(); } return; } Loading @@ -285,7 +285,7 @@ void Element::decRefs(const void *ptr) const if (mComponent.isReference()) { ObjectBase *const*obp = static_cast<ObjectBase *const*>(ptr); ObjectBase *ob = obp[0]; ob->decSysRef(); if (ob) ob->decSysRef(); } return; } Loading