Bug#792672: Assertion error in meters.lv2
Miguel A. Colón Vélez
debian.micove at gmail.com
Fri Jul 17 11:29:04 UTC 2015
Someone at the #debian-multimedia channel dropped this report
<olinuxx> Hi guys, I've a bug to report against x42-plugins
<olinuxx> the meters, both as LV2 or standalone app (x42-meter) who
are normaly displaying a needle are segfaulting
<olinuxx> using them in ardour crash it
<olinuxx> the error log is : x42-meter: ./gui/needle.c:118: void
img2surf(const MyGimpImage*, cairo_surface_t**, unsigned char**):
Assertion `ys + xs < (img->width * img->height +
<olinuxx> (you can get it trying "x42-meter 6" as an example)
<olinuxx> this is the case with a fresh Jessie install with the
backport from stretch, as well as a fresh Stretch install
<olinuxx> I didn't looked deep yet into BTS reporting, so I'm putting
that here, hopefully, someone will pick it up
I looked at the source and the fix is trivial. It should be "*" and
not "+" as in:
-assert (ys + xs < (img->width * img->height + img->bytes_per_pixel));
+assert (ys + xs < (img->width * img->height * img->bytes_per_pixel));
ys + xs is a sequence that accumulates the total number of bytes and it goes
img->bytes_per_pixel, img->bytes_per_pixel*1, img->bytes_per_pixel*2, ...
img->bytes_per_pixel*(img->width * img->height -1)
It seems upstream wanted to bound ys + xs by the next value in the
sequence which is (img->width * img->height * img->bytes_per_pixel).
This makes the assertion always true since it will be short of the
upper bound by at least img->bytes_per_pixel.
Upstream's commit suggest that there may be another issue
with array boundaries but that is independent of this report.
I have never run or compiled these plugins but the math seems to add
up. Hope my pseudo-patch helps.
More information about the pkg-multimedia-maintainers