fix: add an eof check in getInt32 to match getUint16
This commit is contained in:
parent
27bb5fb173
commit
e961764515
@ -104,6 +104,9 @@ class BaseStream {
|
|||||||
const b1 = this.getByte();
|
const b1 = this.getByte();
|
||||||
const b2 = this.getByte();
|
const b2 = this.getByte();
|
||||||
const b3 = this.getByte();
|
const b3 = this.getByte();
|
||||||
|
if (b0 === -1 || b1 === -1 || b2 === -1 || b3 === -1) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
return (b0 << 24) + (b1 << 16) + (b2 << 8) + b3;
|
return (b0 << 24) + (b1 << 16) + (b2 << 8) + b3;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user