LMMS / lmms

Cross-platform music production software
https://lmms.io
GNU General Public License v2.0
8.16k stars 1.01k forks source link

"double free or corruption" when trying to zoom in Song Editor, when there's a large sample loaded #7576

Open ExperiBass opened 2 days ago

ExperiBass commented 2 days ago

System Information

EndeavourOS (Arch Linux)

LMMS Version(s)

1.3.0-alpha.1.720+gada836c98

Most Recent Working Version

e0ae8a1ce (it's not happy, but it doesn't crash)

Bug Summary

When trying to zoom in the song editor, LMMS freezes and crashes with a "double free or corruption (!prev)". A project file + sample to reproduce is attached.

doin a bisect revealed 0363ee6d1 as the offending commit.

Expected Behaviour

LMMS shouldn't freeze and crash.

Steps To Reproduce

  1. Load a long sample (the one im usin is 7m)
  2. try to use the slider to zoom
  3. behold, your wallpaper

Logs

double free or corruption (!prev)
[1]    111944 IOT instruction (core dumped)  lmms

Screenshots / Minimum Reproducible Project

longcrash.zip

Please search the issue tracker for existing bug reports before submitting your own.

khoidauminh commented 1 day ago

I have no idea why this happens but changing this line seems to have made the bug disappear

-       const size_t maxFrames = static_cast<size_t>(numPixels * framesPerPixel);
+       const size_t maxFrames = numPixels * static_cast<size_t>(framesPerPixel);