diff --git a/lib/mp4/builder-impl.js b/lib/mp4/builder-impl.js
index 4ecf51f..3ff833f 100644
--- a/lib/mp4/builder-impl.js
+++ b/lib/mp4/builder-impl.js
@@ -143,7 +143,7 @@ class BuilderImpl {
             elstAtom.entries = [track.duration * this.movie.timescale / track.timescale, 0, 1 << 16];
             if (track.samples.length > 0 && track.samples[0].timestamp > 0) {
                 // add an empty edit
-                let duration = track.samples[0].timestamp * this.movie.timescale / track.timescale;
+                let duration = (track.samples[0].timestamp * this.movie.timescale / track.timescale) >>> 0;
                 elstAtom.entries.unshift(duration, -1, 1 << 16);
             }
 
diff --git a/lib/mp4/parser-impl.js b/lib/mp4/parser-impl.js
index 6dfa3eb..450ad06 100644
--- a/lib/mp4/parser-impl.js
+++ b/lib/mp4/parser-impl.js
@@ -177,7 +177,7 @@ class ParserImpl {
             let editEntries = ParserImpl._getEntries(edtsAtom, Utils.ATOM_ELST);
             if (editEntries.length >= 3 && editEntries[1] === -1) {
                 // apply the first empty edit
-                currentTimestamp = editEntries[0] * track.timescale / this.movie.timescale;
+                currentTimestamp = (editEntries[0] * track.timescale / this.movie.timescale) >>> 0;
             }
         }