Skip to content

Commit fac3072

Browse files
dalecurtischromium-wpt-export-bot
authored andcommitted
[WebCodecs] Fix AV1 corruption test so dav1d actually fails
Test data was insufficiently corrupted, so dav1d just treats it as partial data and expects more data to come. This change increases the corruption of chunks. R=eugene Change-Id: Ia3eeea8faaf9dafe53a0a7fd3c148821fbc91f1d Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7102887 Reviewed-by: Eugene Zemtsov <[email protected]> Commit-Queue: Dale Curtis <[email protected]> Cr-Commit-Position: refs/heads/main@{#1538882}
1 parent 607bde0 commit fac3072

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

webcodecs/videoDecoder-codec-specific-setup.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,8 +189,12 @@ function createVideoDecoder(t, callbacks) {
189189

190190
function createCorruptChunk(index) {
191191
let bad_data = CHUNK_DATA[index];
192-
for (var i = 0; i < bad_data.byteLength; i += 4)
192+
// AV1 may require more extensive corruption to trigger decoding errors with
193+
// some software decoders (e.g., dav1d).
194+
let skip = CONFIG.codec.indexOf('av01') >= 0 ? 2 : 4;
195+
for (var i = 0; i < bad_data.byteLength; i += skip) {
193196
bad_data[i] = 0xFF;
197+
}
194198
return new EncodedVideoChunk(
195199
{type: 'delta', timestamp: index, data: bad_data});
196200
}

0 commit comments

Comments
 (0)