Skip to content
Snippets Groups Projects
Unverified Commit 820b1858 authored by Ann Priestman's avatar Ann Priestman Committed by GitHub
Browse files

Merge pull request #2701 from sepinf-inc/#2699_fix

Fix #2699: use block size from parent VolumeSystem when computing offset
parents 70e6ed51 edb60364
No related branches found
No related tags found
No related merge requests found
...@@ -114,7 +114,13 @@ private long getPoolOffset(Image image) throws TskCoreException { ...@@ -114,7 +114,13 @@ private long getPoolOffset(Image image) throws TskCoreException {
} else if (this.getParent() instanceof Volume) { } else if (this.getParent() instanceof Volume) {
// If the parent is a volume, then the pool starts at the volume offset // If the parent is a volume, then the pool starts at the volume offset
Volume parent = (Volume)this.getParent(); Volume parent = (Volume)this.getParent();
return parent.getStart() * image.getSsize(); // Offset needs to be in bytes if (parent.getParent() instanceof VolumeSystem) {
// uses block size from parent volume system
return parent.getStart() * ((VolumeSystem) parent.getParent()).getBlockSize(); // Offset needs to be in bytes
} else {
// uses sector size from parent image (old behavior fallback)
return parent.getStart() * image.getSsize(); // Offset needs to be in bytes
}
} }
throw new TskCoreException("Pool with object ID " + this.getId() + " does not have Image or Volume parent"); throw new TskCoreException("Pool with object ID " + this.getId() + " does not have Image or Volume parent");
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment