This commit is contained in:
手瓜一十雪 committed 2025-05-12 19:27:01 +08:00
1 parent 999dd93944
commit 056bd591da
1 file changed
+3 -1
+3 -1
View File
@@ -192,7 +192,9 @@ class BmpParser implements ImageParser {
stream.once('error', reject);
stream.once('readable', () => {
const buf = stream.read(26) as Buffer;
if (!buf || buf.length < 26) return resolve(undefined);
if (!buf || buf.length < 26) {
return resolve(undefined);
}
if (this.canParse(buf)) {
const width = buf.readUInt32LE(18);
const height = buf.readUInt32LE(22);