mirror of
https://github.com/dmolony/DiskBrowser.git
synced 2025-02-16 23:30:52 +00:00
Check for shape table
This commit is contained in:
parent
343d460679
commit
871fb79913
@ -134,6 +134,11 @@ public class ShapeTable extends AbstractFile
|
||||
if (totalShapes == 0)
|
||||
return false;
|
||||
|
||||
// this prevents large files that start with a very small value
|
||||
// System.out.printf ("Average shape length: %d%n", buffer.length / totalShapes);
|
||||
if (totalShapes * 500 < buffer.length)
|
||||
return false;
|
||||
|
||||
for (int i = 0; i < totalShapes; i++)
|
||||
{
|
||||
// check index table entry is inside the file
|
||||
@ -149,6 +154,7 @@ public class ShapeTable extends AbstractFile
|
||||
// check offset is unique
|
||||
if (offsets.contains (offset))
|
||||
return false;
|
||||
|
||||
offsets.add (offset);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user