Reject exactly negative transcript timestamps
This commit is contained in:
@@ -183,13 +183,13 @@ func validTimestamp(value fmt.Stringer, label string) (*big.Rat, error) {
|
||||
if math.IsInf(parsed, 0) || math.IsNaN(parsed) {
|
||||
return nil, inputErrorf("%s must be finite", label)
|
||||
}
|
||||
if parsed < 0 {
|
||||
return nil, inputErrorf("%s must not be negative", label)
|
||||
}
|
||||
rat, ok := new(big.Rat).SetString(raw)
|
||||
if !ok {
|
||||
return nil, inputErrorf("%s must be a valid number", label)
|
||||
}
|
||||
if rat.Sign() < 0 {
|
||||
return nil, inputErrorf("%s must not be negative", label)
|
||||
}
|
||||
return rat, nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user