media: Fix logical typo in EmeConfig selection rule accumulation [chromium/src : main]

0 views
Skip to first unread message

Vikram Pasupathy (Gerrit)

unread,
9:54 AM (5 hours ago) 9:54 AM
to chromium...@chromium.org, kinuko...@chromium.org, feature-me...@chromium.org, blink-...@chromium.org

Vikram Pasupathy has uploaded the change for review

Commit message

media: Fix logical typo in EmeConfig selection rule accumulation

Fix a logical typo inside KeySystemConfigSelector::ConfigState::AddRule()
where the 'hw_secure_codecs' branch used '&&' instead of '||'.

Under the previous code, once rules.hw_secure_codecs was set to any
non-unset value (such as kUnset during codec capability checks),
the second condition rules.hw_secure_codecs == EmeConfigRuleState::kUnset
evaluated to false, silently preventing any subsequent robustness rules
(such as 'SW_SECURE_DECODE' on Android which returns 'kRequired') from
correctly upgrading the hardware secure codecs requirement field.

By changing the logical AND (&&) to a logical OR (||), this branch now
correctly matches the behavior of its 'identifier' and 'persistence'
siblings, allowing the hardware secure codecs requirement to be successfully
and correctly updated.

This solves a 4-year-old typo introduced in commit 48f8ca44b5b2e01517c
where the struct-based refactoring of EmeConfig was added, restoring the
intended rule-upgrade and L1/L3 enforcer behaviors.

Added a corresponding unit test to key_system_config_selector_unittest.cc
to cover this real-world Android 'SW_SECURE_DECODE' rule-accumulation upgrade
and prevent regressions.
Bug: 524021234
Change-Id: Ia6fceed55477a953ff945eb63d608abbf84a5f4a

Change diff


Change information

Files:
  • M third_party/blink/renderer/platform/media/key_system_config_selector.cc
  • M third_party/blink/renderer/platform/media/key_system_config_selector_unittest.cc
Change size: S
Delta: 2 files changed, 46 insertions(+), 2 deletions(-)
Open in Gerrit

Related details

Attention set is empty
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: newchange
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Ia6fceed55477a953ff945eb63d608abbf84a5f4a
Gerrit-Change-Number: 8044686
Gerrit-PatchSet: 1
Gerrit-Owner: Vikram Pasupathy <vpasu...@chromium.org>
satisfied_requirement
unsatisfied_requirement
open
diffy
Reply all
Reply to author
Forward
0 new messages