Skip to content

GitLab

  • Menu
Projects Groups Snippets
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • Vorbis Vorbis
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 24
    • Issues 24
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 2
    • Merge requests 2
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Xiph.Org
  • VorbisVorbis
  • Issues
  • #2139
Closed
Open
Created Jan 01, 2015 by Andrew Church@achurch

libvorbis-1.3.4 misdecodes streams with single-symbol codebooks

According to the Vorbis specification (https://xiph.org/vorbis/doc/Vorbis_I_spec.html), "a codebook with a single used entry ... consists of a single codework of zero bits and 'reading' a value out of such a codebook always returns the single used value and sinks zero bits". However, libvorbis-1.3.4 does not follow this requirement, instead sinking a nonzero number of bits (presumably the number specified in the codebook). See the attached sample file.

I will note that the reference encoder does not seem to generate single-symbol codebooks, and the specification is unclear on how they should be encoded (since the bitstream format does not allow one to specify a code length of zero bits). However, I've seen files in the wild which do in fact contain such a codebook, perhaps as a result of some sort of external codebook optimizer.

The attached "sample.ogg" file was created from "original.ogg" by modifying the codebook at index 20 (file offset 0x503 + 1 bit; 18 symbols, of which only symbol 9 of length 3 bits is used) so all unused symbols are excluded from the Huffman decision tree, then deleting the 3 bits which encoded that symbol at the two locations it was used, file offsets 0x3117 + 4 bits and 0x3402 + 6 bits.

Assignee
Assign to
Time tracking