Skip to content

video/vp6: Init nihav decoder with encoded size, not display size#23665

Open
SuchAFuriousDeath wants to merge 1 commit intoruffle-rs:masterfrom
SuchAFuriousDeath:vp6
Open

video/vp6: Init nihav decoder with encoded size, not display size#23665
SuchAFuriousDeath wants to merge 1 commit intoruffle-rs:masterfrom
SuchAFuriousDeath:vp6

Conversation

@SuchAFuriousDeath
Copy link
Copy Markdown
Collaborator

Description

The Vp6Decoder wrapper was passing header.disp_w/disp_h * 16 to VP56Decoder::init, but those are the displayed dimensions, not the encoded ones.

Fixes #23662

Not sure if we want a test is necessary for a change like this.

Testing

I'd like to wait for the swf in #23662, if it's not provided, I guess we could make a test from scratch.

Checklist

  • I, a human, have self-reviewed this PR and fully understand the changes within.
  • I have made or updated tests where possible.
  • All of my commits are properly scoped, compile successfully, and pass all tests.
  • This PR does not make sense to split up into smaller PRs.
  • An LLM was involved in the authoring of this code.

The Vp6Decoder wrapper was passing `header.disp_w/disp_h * 16` to `VP56Decoder::init`, but those are the displayed dimensions, not the encoded ones.

Fixes ruffle-rs#23662
@torokati44
Copy link
Copy Markdown
Member

This is probably correct (at least it feels like it should be), and I'm a bit embarrassed... 🫣
I also wonder how it went unnoticed for so long...
I guess it's just extremely rare to have mb and disp sizes differ.
And now I'm also wondering whether they are used incorrectly somewhere else as well... 🤔

@tygyh
Copy link
Copy Markdown
Contributor

tygyh commented May 8, 2026

Weird edge cases are a great reason to add tests. If it was missed once it can be missed again.

@SuchAFuriousDeath
Copy link
Copy Markdown
Collaborator Author

I wouldn't call this an edge case, it is wrong, it's just rare for itself to manifest.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Error decoding flv encoded with VP6 codec

3 participants