1
0
mirror of https://github.com/garraflavatra/go-fmp.git synced 2025-06-28 04:25:11 +00:00

Return error for sector headers

This commit is contained in:
2025-06-13 12:19:40 +02:00
parent 2748bd9427
commit 7daac38a79
2 changed files with 5 additions and 0 deletions

View File

@ -147,6 +147,10 @@ func (ctx *FmpFile) readSector() (*FmpSector, error) {
NextID: parseVarUint64(buf[8 : 8+4]),
}
if ctx.currentSectorID == 0 && sector.PrevID > 0 {
return nil, ErrBadSectorHeader
}
payload := make([]byte, sectorPayloadSize)
n, err = ctx.stream.Read(payload)