Bug 1728917 [wpt PR 30319] - [WebCodecs] Prevent deeply nested frames., a=testonly
authorDale Curtis <dalecurtis@chromium.org>
Tue, 14 Sep 2021 09:45:33 +0000
changeset 592660 467c2c1baa823709711e4c3044ad80e54b60204d
parent 592659 de6b4dd867cfc4f117a9c4d0bbefb55fadee8689
child 592661 aff0bc45eac69eb168b122c4b723033c8420d979
push id38811
push usernbeleuzu@mozilla.com
push dateWed, 22 Sep 2021 04:09:13 +0000
treeherdermozilla-central@b6fd43458638 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstestonly
bugs1728917, 30319, 1246173, 3140495, 917938
milestone94.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1728917 [wpt PR 30319] - [WebCodecs] Prevent deeply nested frames., a=testonly Automatic update from web-platform-tests [WebCodecs] Prevent deeply nested frames. It's not correct to directly access the wrapped frame since it may itself be wrapping another frame. Prevent nesting, but also switch call sites to not operate directly on |wrapped_frame_| for ease of reasoning. R=sandersd Fixed: 1246173 Change-Id: I1475aa695a1801620eebdcb88a0d421652696261 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3140495 Commit-Queue: Dale Curtis <dalecurtis@chromium.org> Commit-Queue: Dan Sanders <sandersd@chromium.org> Auto-Submit: Dale Curtis <dalecurtis@chromium.org> Reviewed-by: Dan Sanders <sandersd@chromium.org> Cr-Commit-Position: refs/heads/main@{#917938} -- wpt-commits: a607f8c0330f6d6ce92fac257bc47a1fd7fd8706 wpt-pr: 30319
testing/web-platform/tests/webcodecs/videoFrame-drawImage.any.js
--- a/testing/web-platform/tests/webcodecs/videoFrame-drawImage.any.js
+++ b/testing/web-platform/tests/webcodecs/videoFrame-drawImage.any.js
@@ -52,8 +52,24 @@ test(_ => {
   let canvas = new OffscreenCanvas(width, height);
   let ctx = canvas.getContext('2d');
 
   frame.close();
   assert_throws_dom('InvalidStateError', _ => {
     ctx.drawImage(frame, 0, 0);
   }, 'drawImage with a closed VideoFrame should throw InvalidStateError.');
 }, 'drawImage on a closed VideoFrame throws InvalidStateError.');
+
+
+test(_ => {
+  let canvas = new OffscreenCanvas(128, 128);
+  let ctx = canvas.getContext('2d');
+
+  let init = {alpha: 'discard', timestamp: 33090};
+  let frame = new VideoFrame(canvas);
+  let frame2 = new VideoFrame(frame, init);
+  let frame3 = new VideoFrame(frame2, init);
+
+  ctx.drawImage(frame3, 0, 0);
+  frame.close();
+  frame2.close();
+  frame3.close();
+}, 'drawImage of nested frame works properly');