Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only allow some specific Master elements to be set as infinite #176

Merged
merged 12 commits into from
Dec 23, 2023

Commits on Dec 19, 2023

  1. Configuration menu
    Copy the full SHA
    cc9a564 View commit details
    Browse the repository at this point in the history

Commits on Dec 20, 2023

  1. Initialize each EbmlElement with its EbmlCallbacks

    So we have access to the semantic constraints in the constructor.
    robUx4 committed Dec 20, 2023
    Configuration menu
    Copy the full SHA
    73336f6 View commit details
    Browse the repository at this point in the history
  2. Keep information about elements that can have an infinite size

    Only master elements can and only very few.
    robUx4 committed Dec 20, 2023
    Configuration menu
    Copy the full SHA
    1096eb9 View commit details
    Browse the repository at this point in the history
  3. Only set infinite size if it's allowed for that EBML Element class

    And assert if an illegal call is done.
    robUx4 committed Dec 20, 2023
    Configuration menu
    Copy the full SHA
    8cb3382 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    8326415 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    267901a View commit details
    Browse the repository at this point in the history
  6. Don't test infinite size for elements that can never be infinite

    Only master elements can be.
    robUx4 committed Dec 20, 2023
    Configuration menu
    Copy the full SHA
    43e52eb View commit details
    Browse the repository at this point in the history
  7. Assume an EbmlVoid element cannot be inifinite

    Because it's a binary element, not a Master element.
    robUx4 committed Dec 20, 2023
    Configuration menu
    Copy the full SHA
    587d7ff View commit details
    Browse the repository at this point in the history
  8. Document the return value of SetSizeInfinite()

    Setting whatever on an EbmlMaster returns true.
    Setting true on other classes returns false.
    Setting false on other classes returns true.
    robUx4 committed Dec 20, 2023
    Configuration menu
    Copy the full SHA
    210a56b View commit details
    Browse the repository at this point in the history
  9. Only return true when SetSizeInfinite() worked

    Fixes an issue in EbmlElement::FindNextID() where an EbmlMaster was set to
    infinite/unknown even though it's not allowed for that element.
    
    EbmlElement::FindNextElement() would also allow an infinite/unknown size
    for any master element even though it's not allowed.
    
    That should improve error recovery by skipping more invalid sizes given the reading context.
    robUx4 committed Dec 20, 2023
    Configuration menu
    Copy the full SHA
    609fcdb View commit details
    Browse the repository at this point in the history
  10. make EbmlElement::SetSizeInfinite() non virtual

    We can simplify use the semantic of each element directly.
    
    And the assert will work all any element, not just the master ones.
    robUx4 committed Dec 20, 2023
    Configuration menu
    Copy the full SHA
    88467bf View commit details
    Browse the repository at this point in the history

Commits on Dec 22, 2023

  1. Don't assert when calling incorrectly SetSizeInfinite()

    It is called in FindNextId/FindNextElement which always checks for failure.
    So don't need the assert there.
    
    It's also called from the EbmlMaster constructor.
    The copy constructor is fine since the the original can only have a valid state.
    The other constructor has a default value of finite size and the macros never set this to infinite.
    In libmatroska the KaxSegment constructor calls SetSizeInfinite() rather than using the default value.
    But we don't need an assert there, since we know it's allowed.
    robUx4 committed Dec 22, 2023
    Configuration menu
    Copy the full SHA
    ca5d9f8 View commit details
    Browse the repository at this point in the history