fix: add an eof check in getInt32 to match getUint16

This commit is contained in:
Sachin Iyer 2025-10-31 16:47:44 -07:00
parent 27bb5fb173
commit e961764515

View File

@ -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;
} }