Files
sousa-gecko/dom/media/webcodecs/crashtests/2017470.html
T
Paul Adenot 6ccd87a3d3 Bug 2017470 - Throw TypeError when computed VideoFrame display size is zero. r=alwu
When copying a VideoFrame with a new visibleRect but no explicit display size,
the display size is scaled proportionally. If the source frame has a very small
display dimension relative to its visible size (e.g. displayHeight=1, visibleHeight=150),
the scaled result can round to zero, which later triggers an assertion.

Throw a TypeError instead, consistent with how explicit zero display dimensions
are rejected in ValidateVideoFrameInit.

Spec issue: https://github.com/w3c/webcodecs/issues/926

Differential Revision: https://phabricator.services.mozilla.com/D284123
2026-02-20 16:25:24 +00:00

18 lines
343 B
HTML

<canvas id="c"></canvas>
<script>
document.addEventListener('DOMContentLoaded', () => {
const f0 = new VideoFrame(c, {
timestamp: 1993811,
displayWidth: 1280,
displayHeight: 1
})
const f1 = new VideoFrame(f0, {
visibleRect: {
width: 187,
height: 40
}
})
const _ = new VideoFrame(f1, { })
})
</script>