Skip to content

Commit

Permalink
epam#77 Fixed offset calculation for deleted records
Browse files Browse the repository at this point in the history
Actually `vars.get(0)` is array of 4 bytes (its length is based on a SasFileConstants.PAGE_DELETED_POINTER_LENGTH = 4). So, it is more correct to use bytesToInt() conversion here instead of bytesToShort().
  • Loading branch information
xantorohara committed Dec 15, 2020
1 parent 4c9f4fd commit 02560a9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/java/com/epam/parso/impl/SasFileParser.java
Original file line number Diff line number Diff line change
Expand Up @@ -776,7 +776,7 @@ private void readDeletedInfo() throws IOException {
List<byte[]> vars = getBytesFromFile(new Long[] {deletedPointerOffset},
new Integer[] {PAGE_DELETED_POINTER_LENGTH});

long currentPageDeletedPointer = bytesToShort(vars.get(0));
long currentPageDeletedPointer = bytesToInt(vars.get(0));
long deletedMapOffset = bitOffset + currentPageDeletedPointer + alignCorrection
+ (currentPageSubheadersCount * subheaderPointerLength)
+ ((currentPageBlockCount - currentPageSubheadersCount) * sasFileProperties.getRowLength());
Expand Down

0 comments on commit 02560a9

Please sign in to comment.