Closed Bug 1695033 Opened 3 years ago Closed 3 years ago

Webm files fail to play if they have metadata with dimensions greater than those derived form in band video information

Categories

(Core :: Audio/Video: Playback, defect, P3)

Firefox 86
defect

Tracking

()

RESOLVED FIXED
88 Branch
Tracking Status
firefox-esr78 --- unaffected
firefox86 --- wontfix
firefox87 --- fixed
firefox88 --- fixed

People

(Reporter: leo, Assigned: bryce)

References

(Regression)

Details

(Keywords: regression)

Attachments

(3 files)

User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:85.0) Gecko/20100101 Firefox/85.0

Steps to reproduce:

  1. Installed firefox version 86 for Linux via Mint repository
  2. attempted to connect to webm/vorbis streaming video (TV)
  3. got error message Video can't be played because the file is corrupt
  4. downgraded to previous version
  5. stream plays correctly

Actual results:

got error message "Video can't be played because the file is corrupt"

Expected results:

stream plays correctly

The Bugbug bot thinks this bug should belong to the 'Core::Audio/Video: Playback' component, and is moving the bug to that component. Please revert this change in case you think the bot is wrong.

Component: Untriaged → Audio/Video: Playback
Product: Firefox → Core

This is erroneously reported as a version 85 bug but it applies to version 86 <i>only</i>

The streams in question are on a private server that streams live UK TV so are not legally accessible to non UK TV license holders. I can provide temporary login details to anyone working on the problem however.

Assignee: nobody → bvandyk
Severity: -- → S3
Priority: -- → P3
Status: UNCONFIRMED → NEW
Ever confirmed: true
Regressed by: 1637658
Has STR: --- → yes
Keywords: regression
Version: Firefox 85 → Firefox 86
Has Regression Range: --- → yes

I think I have a good handle what's going on here. The issue is the result of a few things:

  • The site is sending a VP8 stream in a webm where the webm metadata and the VP8 stream data differ. The webm says the stream will be 544x576 but the vp8 stream says 362x384. This alone is not enough to cause a problem.
  • However, bug 1637658 introduced some changes to how we handle the above case. This change overlooked the need to reset the image rectangle when resolutions change (as we do in other such cases[0]). This means we end up with frames that are mostly treated as 362x384, but which will eventually fail when we calculate the scaled image rectangle[1]. More specifically, the scaled image rect will be 544x576 and will fail and overflow check later where those dimensions are too large for the smaller 362x384 image[2].

Tests and fix incoming.

[0] https://searchfox.org/mozilla-central/rev/eeb8cf278192d68b3977d0adb4d43f1463439269/dom/media/platforms/wrappers/MediaChangeMonitor.cpp#193
[1] https://searchfox.org/mozilla-central/rev/eeb8cf278192d68b3977d0adb4d43f1463439269/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.cpp#701
[2] https://searchfox.org/mozilla-central/rev/eeb8cf278192d68b3977d0adb4d43f1463439269/dom/media/MediaData.cpp#192-193

Summary: Version 86 breaks webm video 'corrupt file' → Webm files fail to play if they have metadata with dimensions greater than those derived form in band video information

This patch

  • adds several test files derived from bipbop.mp4. These files are re-encodes
    that used vp8 and opus. One reference file is added with metadata that is
    correct, and several others are added with bad metadata (it doesn't match the
    stream resolution).
  • adds these files to the gPlayTests to ensure we can play them.

This makes debugging decode failures using logs a little nicer when we hit these
cases.

Depends on D107723

This avoids an issue where we end up with invalid sizes if the metadata in a
webm file has a greater resolution than the in band video data.

Depends on D107724

Attachment #9207904 - Attachment description: Bug 1695033 - Reset image rectangle in the MediaChangeMonitor when chaning resolutions. r?alwu → Bug 1695033 - Reset image rectangle in the MediaChangeMonitor when changing resolutions. r?alwu

Bumping severity of this. This could have a pretty nasty consequences. The regressing bug intended to stop us incorrectly displaying videos where the initial metadata disagrees with the in band data. In that bug the initial data had smaller dimensions than the in band data and that worked okay, howwever, as seen here, if the initial data has bigger dimensions it's fatal. It's not clear to me how widespread sites doing this are (hopefully not), but playback/WebRTC would be broken for these sites.

Severity: S3 → S2

Try run in preparation for landing.

Pushed by bvandyk@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/459745537b9b
Add test cases for vp8 container stream dimension mismatch. r=alwu
https://hg.mozilla.org/integration/autoland/rev/a74c36f659b6
Log error message in OnAudioNotDecoded + OnVideoNotDecoded. r=alwu
https://hg.mozilla.org/integration/autoland/rev/db7158dfb86d
Reset image rectangle in the MediaChangeMonitor when changing resolutions. r=alwu

Given comment 8 do we want this in 87? We build the last beta today.

Flags: needinfo?(bvandyk)

Comment on attachment 9207904 [details]
Bug 1695033 - Reset image rectangle in the MediaChangeMonitor when changing resolutions. r?alwu

Beta/Release Uplift Approval Request

  • User impact if declined: Some videos will be fatally broken without a workaround. Affect media is VP8 (and likely VP9) videos contained in a WebM container where that container specifies greater dimensions than are in the actual video stream.
  • Is this code covered by automated tests?: Yes
  • Has the fix been verified in Nightly?: Yes
  • Needs manual test from QE?: No
  • If yes, steps to reproduce:
  • List of other uplifts needed: None.
  • Risk to taking this patch: Low
  • Why is the change risky/not risky? (and alternatives if risky): The patch is small and and enforces a mechanism that already exists in other code paths (i.e. it's not introducing a major new media path). 'Reset image rectangle in the MediaChangeMonitor when changing resolutions.' is the only patch strictly needed, the others contain tests and log changes and do not need uplift if we wish to reduce the code volume. But similarly, they're unlikely to cause issue since they're not functional changes seen by end users.
  • String changes made/needed:
Flags: needinfo?(bvandyk)
Attachment #9207904 - Flags: approval-mozilla-beta?
Attachment #9207902 - Flags: approval-mozilla-beta?
Attachment #9207903 - Flags: approval-mozilla-beta?

Comment on attachment 9207902 [details]
Bug 1695033 - Add test cases for vp8 container stream dimension mismatch. r?alwu

Thanks Bryce. Approved for 87.0b9

Attachment #9207902 - Flags: approval-mozilla-beta? → approval-mozilla-beta+
Attachment #9207903 - Flags: approval-mozilla-beta? → approval-mozilla-beta+
Attachment #9207904 - Flags: approval-mozilla-beta? → approval-mozilla-beta+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: