diff --git a/src/display/editor/stamp.js b/src/display/editor/stamp.js index fc15ea7270b79..12e9f65ff28fd 100644 --- a/src/display/editor/stamp.js +++ b/src/display/editor/stamp.js @@ -169,7 +169,9 @@ class StampEditor extends AnnotationEditor { const response = await mlManager.guess({ name: "altText", request: { - data, + // Pass a buffer to avoid copy, see "run" method in: + // https://searchfox.org/mozilla-central/source/toolkit/components/ml/actors/MLEngineParent.sys.mjs + data: data.buffer, width, height, channels: data.length / (width * height),