Skip to content

Commit

Permalink
properly check that index is in valid interval
Browse files Browse the repository at this point in the history
  • Loading branch information
wladich committed Dec 5, 2020
1 parent a4191d3 commit ed023fe
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/dem/reader.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ func decompressTile(compressed []byte) (*TileRawData, error) {
func (storage *StorageReader) GetTile(index TileIndex) (*Tile, error) {
x := index.X + 180*HgtSplitParts
y := index.Y + 90*HgtSplitParts
if x < 0 || y < 0 || x > len(storage.index) || y > len(storage.index[x]) {
if x < 0 || y < 0 || x >= len(storage.index) || y >= len(storage.index[x]) {
return nil, nil
}
tileFileIndex := storage.index[x][y]
Expand Down

0 comments on commit ed023fe

Please sign in to comment.