Skip to content

[FragmentedSampleReader] Fix transitions from unencrypted fragments to encrypted#1790

Merged
CastagnaIT merged 1 commit intoxbmc:Piersfrom
glennguy:fix_unencrypted_transition
Mar 23, 2025
Merged

[FragmentedSampleReader] Fix transitions from unencrypted fragments to encrypted#1790
CastagnaIT merged 1 commit intoxbmc:Piersfrom
glennguy:fix_unencrypted_transition

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?

Tested on Windows

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

@CastagnaIT CastagnaIT added Type: Fix non-breaking change which fixes an issue v22 Piers Backport: Done labels Mar 23, 2025
Copy link
Copy Markdown
Collaborator

@CastagnaIT CastagnaIT left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thank you very much

@CastagnaIT CastagnaIT merged commit 6b8cb37 into xbmc:Piers Mar 23, 2025
9 checks passed
@CastagnaIT CastagnaIT mentioned this pull request Mar 23, 2025
11 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Backport: Done Type: Fix non-breaking change which fixes an issue v22 Piers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants