Skip to content

Commit

Permalink
Merge "We need to update mPos when we copy a FieldPacker via its data…
Browse files Browse the repository at this point in the history
…[] member."
  • Loading branch information
stephenhines authored and Gerrit Code Review committed Jun 24, 2014
2 parents 0b57289 + fcb3161 commit 44023a4
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion rs/java/android/renderscript/FieldPacker.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,15 @@ public FieldPacker(int len) {
}

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) {
Expand Down

0 comments on commit 44023a4

Please sign in to comment.