Skip to content

[0.4.x] Plugins (JESS): Fix 8-bit blur without MMX - #433

Merged
hartwork merged 1 commit into
Libvisual:0.4.xfrom
fmolara:plugins-fix-jess-8bit-blur
Nov 21, 2026
Merged

hartwork merged 1 commit into
Libvisual:0.4.xfrom
fmolara:plugins-fix-jess-8bit-blur

Conversation

@fmolara

@fmolara fmolara commented Nov 1, 2026 •

Copy link
Copy Markdown

The scalar 8-bit blur loop uses an uninitialized upper bound: render_blur()
assigns bmax only inside the MMX branch, although the non-MMX branch also
uses it to stop iterating over the pixel buffer. This can run past the
buffer and crash while rendering an 8-bit surface.

Move the existing assignment before the MMX/non-MMX branch so both paths
use the same initialized bound. The loop and bound calculation are
otherwise unchanged.

Validation with a headless libvisual client rendering 16 frames into a
320x240 8-bit surface, fed with synthetic stereo audio:

  • Before the fix: SIGSEGV in render_blur() on native amd64 and sh4 under
    QEMU. GDB identifies the scalar loop at renderer.c:421.
  • After the fix: all 16 frames complete with rendered output on both
    native amd64 and sh4/QEMU.
  • The unchanged sh4 plugin also completes with a 32-bit surface, isolating
    the failing case to the 8-bit path.

This targets 0.4.x and changes only the JESS renderer.

CI status: all four Linux/macOS build-and-test jobs and the help-output
check pass. The translation-sync job stops during the core configure
step with "Invalid configuration '\'", before catalog comparison. Its
translations.yml has a trailing backslash on the final --prefix line;
that workflow is unchanged between the fork base and current 0.4.x.
No workflow or catalog files are changed by this PR.

The non-MMX 8-bit loop uses bmax without initializing it, which can
iterate beyond the pixel buffer and crash. Move the existing assignment
before the MMX/non-MMX branch so both paths use the same initialized bound.
@fmolara

fmolara commented Nov 21, 2026

Copy link
Copy Markdown
Author

This fix is now in Debian testing and unstable, with successful builds and autopkgtests on all eight release architectures. Could you please review it when you have a chance? Thanks!

@hartwork hartwork left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@fmolara thanks for bringing this up! I find that the 0.5.x master branch agrees with this idea…

https://github.com/Libvisual/libvisual/blob/master/libvisual-plugins/plugins/actor/jess/renderer.c#L387-L391

…and for some reason branch 0.4.x did not have this fix backported.

The red CI error…

Invalid configuration '\': machine '\-unknown' not recognized

…is unrelated and not your fault. I have taken care of it just now via PR #435 and expect 0.4.x to be all-green after a rebase-merge of your pull request here.

Thank you!

@hartwork hartwork added this to the 0.4.3 milestone Nov 21, 2026
@hartwork hartwork added the bug label Nov 21, 2026
@hartwork
hartwork merged commit 85af4d4 into Libvisual:0.4.x Nov 21, 2026
5 of 6 checks passed
@kaixiong

Copy link
Copy Markdown
Member

As a note, master already has this fix in 0af3a9b since 2012.

@fmolara

fmolara commented Nov 22, 2026

Copy link
Copy Markdown
Author

Thanks for the reference, and apologies for overlooking your original fix. I should have checked the history of master before preparing this patch for 0.4.x.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants