Skip to content

Fix invalid sample counts in planar audio shrink - #1345

Merged
ddennedy merged 1 commit into
mltframework:masterfrom
darkdi:fix/audio-shrink-invalid-samples
Oct 16, 2026
Merged

ddennedy merged 1 commit into
mltframework:masterfrom
darkdi:fix/audio-shrink-invalid-samples

Conversation

@darkdi

@darkdi darkdi commented Oct 16, 2026

Copy link
Copy Markdown
Contributor

mlt_audio_shrink() checks for negative or non-shrinking sample counts, but then falls through into a separate planar-data if. With three channels and four samples per channel, asking for five samples causes a heap-buffer-overflow under AddressSanitizer; asking for -1 passes a negative size to memmove. Both reproduce with mlt_audio_s32 and mlt_audio_float.

Make the planar move an else if so those requests leave the audio unchanged, as the existing guard intends. The data-driven regression covers negative, equal, larger, smaller, and zero counts in both formats, including channel contents after shrinking.

Validation on macOS arm64: all 15 configured QtTest suites passed, including the 10 new audio cases; the same 10-case native probe passed against the ASan build (the four invalid-size cases failed before the change). The clang-format-14 check passed.

Signed-off-by: Dmitry Rantovov <rantovov5@gmail.com>
@ddennedy ddennedy added this to the v7.44.0 milestone Oct 16, 2026
@ddennedy
ddennedy merged commit dee146e into mltframework:master Oct 16, 2026
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants