w3c / webcodecs

WebCodecs is a flexible web API for encoding and decoding audio and video.
https://w3c.github.io/webcodecs/
Other
1k stars 137 forks source link

visibleRect validation for VideoFrame{Buffer}Init seems wrong #515

Closed ChunMinChang closed 2 years ago

ChunMinChang commented 2 years ago

Validate VideoFrameInit and Validate VideoFrameBufferInit return false when visibleRect.y + visibleRect.height >= codedHeight in step 1-5 and step 3 respectively, or visibleRect.x + visibleRect.width >= codedWidth in step 1-6 and step 4 respectively, while Parse Visible Rect returns false when overrideRect.y + overrideRect.height > codedHeight or overrideRect.x + overrideRect.width > codedWidth. Shouldn’t Validate VideoFrameInit and Validate VideoFrameBufferInit return false in the “>” case instead of “>=”? A VideoFrame{Buffer}Init value with a visibleRect whose (x, y, width, height) = (0, 0, 2, 2), codedWidth=2 and codedHeight=2 seems valid.

sandersdan commented 2 years ago

Sounds correct to me; the inequality should be strict.

Probably an editing error swapping from <= valid to > invalid.