Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Register
  • Sign in
  • pulseaudio pulseaudio
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 893
    • Issues 893
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 47
    • Merge requests 47
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar

Due to an influx of spam, we have had to impose restrictions on new accounts. Please see this wiki page for instructions on how to get full permissions. Sorry for the inconvenience.

  • PulseAudioPulseAudio
  • pulseaudiopulseaudio
  • Merge requests
  • !778

resampler: Fix oversized memblock pushed from resampler

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Igor Kovalenko requested to merge igor.v.kovalenko/pulseaudio:pr/issue-1425-misaligned-srb-memblock into master Feb 08, 2023
  • Overview 4
  • Commits 1
  • Pipelines 3
  • Changes 1

The assumption that the format enum is ordered by size is not valid for quite some time, since 24bit formats were appended to format enum later than 32bit formats. This causes resampler to produce properly aligned memblock of size larger than maximum mempool block size if input format is 24bit and output format is 32bit.

Oversized block is getting split by pa_pstream_send_memblock() into parts of size not exceeding maximum mempool block size. This usually works well but for 32ch 32bit 48000Hz stream the frame alignment is 128 bytes and maximum mempool block size value is multiple of 64 but not 128 bytes, therefore resulting parts are misaligned.

On receiving side this causes extra allocation of 128 byte chunk while mcalign helper reassembles properly aligned frame out of second block of misaligned size. While first and second properly aligned frames are retrieved successfully from mcalign helper, third retrieved frame would end up with properly aligned size but misaligned memblock index (in this example, that would be 64 bytes.) Attempt to push a chunk with misaligned memblock index causes assertion failure

  Assertion 'uchunk->index % bq->base == 0' failed at memblockq.c:289,
    function pa_memblockq_push(). Aborting.

Fix oversized block issue by checking proper size of format instead of enum value.

Fixes: a67c21f0 ("merge 'lennart' branch back into trunk.") Bug: #1425 (closed)

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: pr/issue-1425-misaligned-srb-memblock