Issue 1774 in webm: Maximum width and height are off by one in validate_config() in vp9/vp9_cx_iface.c

15 views
Skip to first unread message

w… via monorail

unread,
Jul 29, 2022, 6:38:52 PM7/29/22
to webm-d...@webmproject.org
Status: Started
Owner: w...@google.com
CC: jz...@google.com
Labels: Type-Bug Pri-2

New issue 1774 by w...@google.com: Maximum width and height are off by one in validate_config() in vp9/vp9_cx_iface.c
https://bugs.chromium.org/p/webm/issues/detail?id=1774

This bug is the VP9 version of https://crbug.com/aomedia/3304.

The validate_config() function in vp9/vp9_cx_iface.c has the following checks:

RANGE_CHECK(cfg, g_w, 1, 65535); // 16 bits available
RANGE_CHECK(cfg, g_h, 1, 65535); // 16 bits available

The maximum value of g_w and g_h should be 65536 (= 2^16), not 65535. This comes from the following syntax elements in the frame_size() function in Section 6.2.3 of the VP9 spec:

https://storage.googleapis.com/downloads.webmproject.org/docs/vp9/vp9-bitstream-specification-v0.6-20160331-draft.pdf

frame_width_minus_1 f(16)
frame_height_minus_1 f(16)
FrameWidth = frame_width_minus_1 + 1
FrameHeight = frame_height_minus_1 + 1

The maximum value of frame_width_minus_1 is 2^16-1 = 65535. Therefore the max value of FrameWidth is 65535 + 1 = 65536.

--
You received this message because:
1. The project was configured to send all issue notifications to this address

You may adjust your notification preferences at:
https://bugs.chromium.org/hosting/settings

Git Watcher via monorail

unread,
Jul 30, 2022, 4:12:18 AM7/30/22
to webm-d...@webmproject.org

Comment #1 on issue 1774 by Git Watcher: Maximum width and height are off by one in validate_config() in vp9/vp9_cx_iface.c
https://bugs.chromium.org/p/webm/issues/detail?id=1774#c1

The following revision refers to this bug:
https://chromium.googlesource.com/webm/libvpx/+/0b3d4114468e8b602ece9b28f2485c60394311ca

commit 0b3d4114468e8b602ece9b28f2485c60394311ca
Author: Wan-Teh Chang <w...@google.com>
Date: Fri Jul 29 22:42:15 2022

Fix off-by-one error of max w/h in validate_config

Fix the off-by-one errors of maximum g_w and g_h in validate_config().

Bug: webm:1774
Change-Id: I343783d06c1f53222be2366be79171b214486201

[modify] https://crrev.com/0b3d4114468e8b602ece9b28f2485c60394311ca/vp9/vp9_cx_iface.c

w… via monorail

unread,
Jul 30, 2022, 4:13:21 AM7/30/22
to webm-d...@webmproject.org
Updates:
Status: Fixed

Comment #2 on issue 1774 by w...@google.com: Maximum width and height are off by one in validate_config() in vp9/vp9_cx_iface.c
https://bugs.chromium.org/p/webm/issues/detail?id=1774#c2

(No comment was entered for this change.)
Reply all
Reply to author
Forward
0 new messages