Skip to content

Wave Malformed Blockalign Bugfix #409

@R0yAdar

Description

@R0yAdar

Hi! I stumbled upon an undefined behavior when trying to decode a wave file with malformed block-align field (it wasn't divided by 8 by the encoder).

As both Windows Media Player and ffmpeg play the file correctly (they most likely only look at the bits-per-sample field), I had to debug it manually to find the problem. So, turns out Symphonia uses both the BPS & the BlockAlign fields, yikes.

I propose to add a check like:

Image

Of course there are other edge cases that can cause UBs, but they'll have to be more deliberate and also they most likely won't be played correctly by other software.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions