Skip to content

[Backport] [FragmentedSampleReader] Fix transitions from unencrypted fragments to encrypted#1791

Merged
CastagnaIT merged 1 commit intoxbmc:Omegafrom
glennguy:fix_unencrypted_transition_omega
Mar 23, 2025
Merged

[Backport] [FragmentedSampleReader] Fix transitions from unencrypted fragments to encrypted#1791
CastagnaIT merged 1 commit intoxbmc:Omegafrom
glennguy:fix_unencrypted_transition_omega

Conversation

@glennguy
Copy link
Copy Markdown
Contributor

Description

UpdateSampleDescription() will update the m_protectedDesc member variable, but never clear it when the sample description box says there is no protection. Since ProcessMoof() makes a decision to process the fragment as decrypted or not based on this variable being assigned or not, we can end up decrypting unencrypted content. On windows, trying to 'play' unencrypted audio content can cause a crash.

This change will clear the m_protectedDesc member when the fragment is not protected, allowing other logic to function as intended

Motivation and context

Fixes playback of the CBCS Google 'Tears of Steel' sample stream. This stream starts with the first fragment unencrypted. We however populate m_protectedDesc because the Initialize() method uses a magic number (0) get the first sample description, regardless of what sample description is specified for in the first fragment. This should be looked at in the future.

How has this been tested?

Screenshots (if appropriate):

Types of change

  • Bug fix (non-breaking change which fixes an issue)
  • Clean up (non-breaking change which removes non-working, unmaintained functionality)
  • Improvement (non-breaking change which improves existing functionality)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that will cause existing functionality to change)
  • Cosmetic change (non-breaking change that doesn't touch code)
  • None of the above (please explain below)

Checklist:

  • I have read the Contributing document
  • My code follows the Code Guidelines of this project
  • My change requires a change to the Wiki documentation
  • I have updated the documentation accordingly

@glennguy glennguy added Type: Fix non-breaking change which fixes an issue Type: Backport v21 Omega labels Mar 23, 2025
@glennguy glennguy force-pushed the fix_unencrypted_transition_omega branch from be0020e to fcfdb68 Compare March 23, 2025 06:49
@CastagnaIT CastagnaIT merged commit fef4b75 into xbmc:Omega Mar 23, 2025
2 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Type: Backport Type: Fix non-breaking change which fixes an issue v21 Omega

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants