Skip to content

https://w3c.github.io/webcodecs/#dom-videoframe-videoframe-data-init should validate the plane layout according the coded width and height  #702

Open

Description

@youennf

https://w3c.github.io/webcodecs/#dom-videoframe-videoframe-data-init step 9 is computing the plane layout according parsedRect which is computed from visibleWidth/visibleHeight.
It seems codedWidth and codedHeight should be used instead, which would be consistent with checking whether the buffer is large enough.
See also https://bugs.webkit.org/show_bug.cgi?id=256848.

Activity

  1. sandersdan commented on Jul 10, 2023

    @sandersdan
    Contributor

    Agreed, combinedLayout is only used to run the check in step 11, which should be making sure that the buffer is large enough to contain the entire coded region of the frame. It's not necessary to compute anything related to the visible region here, but Compute Layout and Allocation Size algorithm is shared with copyTo() which does.

    The complexity comes from having to support explicit and implicit layouts. The actual check just needs to ensure that the buffer contains the full planeCodedHeight * planeStride bytes for every plane.

    It could be worth making this more obvious because using planeCodedWidth * planeSampleBytes for the last row instead of planeStride might be logical but would differ from the spec intention.

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions