am ed24d3f2: am db3bcfb8: am 44023a4f: Merge "We need to update mPos when we copy a FieldPacker via its data[] member."
* commit 'ed24d3f2e991906973afce8aa6a3fa54f4a3e4df':
We need to update mPos when we copy a FieldPacker via its data[] member.
diff --git a/rs/java/android/renderscript/FieldPacker.java b/rs/java/android/renderscript/FieldPacker.java
index f39aa5f..20b07e7 100644
--- a/rs/java/android/renderscript/FieldPacker.java
+++ b/rs/java/android/renderscript/FieldPacker.java
@@ -36,10 +36,15 @@
}
public FieldPacker(byte[] data) {
- mPos = 0;
+ // Advance mPos to the end of the buffer, since we are copying in the
+ // full data input.
+ mPos = data.length;
mLen = data.length;
mData = data;
mAlignment = new BitSet();
+ // TODO: We should either have an actual FieldPacker copy constructor
+ // or drop support for computing alignment like this. As it stands,
+ // subAlign() can never work correctly for copied FieldPacker objects.
}
public void align(int v) {