mirror of
https://github.com/dmolony/DiskBrowser.git
synced 2025-02-21 11:28:58 +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)
|
if (totalShapes == 0)
|
||||||
return false;
|
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++)
|
for (int i = 0; i < totalShapes; i++)
|
||||||
{
|
{
|
||||||
// check index table entry is inside the file
|
// check index table entry is inside the file
|
||||||
@ -149,6 +154,7 @@ public class ShapeTable extends AbstractFile
|
|||||||
// check offset is unique
|
// check offset is unique
|
||||||
if (offsets.contains (offset))
|
if (offsets.contains (offset))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
offsets.add (offset);
|
offsets.add (offset);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user