tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

commit 0f3cfd396e3a739adf273fe18cda72107a748dad
parent bc0126d69fb1bc9244d2a48db7fb8f38bee93261
Author: Cristina Murillo <cmurillo@igalia.com>
Date:   Thu, 27 Nov 2025 15:25:21 +0000

Bug 2000024 [wpt PR 56017] - Fix mungeLevel function to zero-pad single-digit H.264 level hex values, a=testonly

Automatic update from web-platform-tests
Fix mungeLevel function to zero-pad single-digit H.264 level hex values (#56017)

The mungeLevel function is not zero-padding hex values, therefore breaking level encoding for H264 levels 1, 1.1, 1.2, and 1.3.
Without padding, single-digit hex values create invalid profile-level-id strings with only 5 total characters instead of 6.
The profile-level-id should have a size of 3 bytes.

For example, for level 1.0:
1 * 10 = 10, equal to hex 'a' which leads to 0x42e0a instead of 0x42e00a.

This patch ensures all hex values are zero-padded to 2-digits.
--

wpt-commits: d4ac1109ed58bf55929d88d031d7b4237a10cac1
wpt-pr: 56017

Diffstat:
Mtesting/web-platform/tests/webrtc/protocol/h264-profile-levels.https.html | 2+-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/testing/web-platform/tests/webrtc/protocol/h264-profile-levels.https.html b/testing/web-platform/tests/webrtc/protocol/h264-profile-levels.https.html @@ -10,7 +10,7 @@ <script> function mungeLevel(sdp, level) { - level_hex = Math.round(level * 10).toString(16); + level_hex = Math.round(level * 10).toString(16).padStart(2, '0'); return { type: sdp.type, sdp: sdp.sdp.replace(/(profile-level-id=....)(..)/g,