Skip to content

Commit

Permalink
add missing fd close
Browse files Browse the repository at this point in the history
  • Loading branch information
vpalmisano committed Apr 12, 2024
1 parent 62a17f7 commit 39bb23a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/vmaf.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ export async function parseIvf(
const headerView = new DataView(headerData)
const ret = await fd.read(headerView, 0, 32, 0)
if (ret.bytesRead !== 32) {
await fd.close()
throw new Error('Invalid IVF file')
}
const width = headerView.getUint16(12, true)
Expand Down Expand Up @@ -209,9 +210,9 @@ export async function parseIvf(
frames = recognizedFrames
}

const ptsIndex = Array.from(frames.keys()).sort((a, b) => a - b)

await fd.close()

const ptsIndex = Array.from(frames.keys()).sort((a, b) => a - b)
return { width, height, frameRate, ptsIndex, frames, participantDisplayName }
}

Expand Down

0 comments on commit 39bb23a

Please sign in to comment.