After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 682171 - videoscale: assertion failed: (envelope ((x - (xi - 1)) * ex) == 0)
videoscale: assertion failed: (envelope ((x - (xi - 1)) * ex) == 0)
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-base
git master
Other Linux
: Normal normal
: 1.0.7
Assigned To: David Schleef
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2012-08-18 20:13 UTC by Jason Gerard DeRose
Modified: 2013-04-13 13:07 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Jason Gerard DeRose 2012-08-18 20:13:47 UTC
"videoscale" fails when using method=3 (lanczos) and sharpness=0.0

$ gst-launch-1.0 filesrc location=MVI_5751.MOV  ! decodebin ! videoscale method=3 sharpness=0.0 ! video/x-raw,height=144,pixel-aspect-ratio=1/1 ! fakesink
Setting pipeline to PAUSED ...
Pipeline is PREROLLING ...
**
ERROR:vs_lanczos.c:316:scale1d_calculate_taps: assertion failed: (envelope ((x - (xi - 1)) * ex) == 0)
Aborted (core dumped)
Comment 1 David Jordan 2012-08-18 23:14:12 UTC
I've checked this out and the number of taps used by the lanczos filter explodes to infinity as the sharpness value goes to zero.  At sharpness == 0.0 this causes x and xi to reach maximum negative values and results in xi overflowing, which causes the assertion to fail.
At least for the lanczos filter, sharpness should not be allowed to actually reach zero.  I'm not sure the best solution to mitigate this is, however.
Comment 2 Jason Gerard DeRose 2012-08-19 00:37:02 UTC
g_param_spec_double() only allows you to define the value range inclusively, so it's not possible to express this:

0.0 < sharpness <= 2.0

http://developer.gnome.org/gobject/unstable/gobject-Standard-Parameter-and-Value-Types.html#g-param-spec-double

I think setting the minimum value to 0.1 or whatever makes sense would probably be a good fix.

The computational impacts of using a sharpness close to zero should also be documented, considering it's asymptotic and all.
Comment 3 Stefan Sauer (gstreamer, gtkdoc dev) 2013-04-05 20:01:07 UTC
We can use DBL_MIN instead of 0.0
Comment 4 Stefan Sauer (gstreamer, gtkdoc dev) 2013-04-05 20:03:15 UTC
Okay to change this? I think it is, as setting this value would crash anyway.
Comment 5 Stefan Sauer (gstreamer, gtkdoc dev) 2013-04-05 20:40:55 UTC
commit c2b34b05de5a3fa0b12d749b89d4d655916aac49
Author: Stefan Sauer <ensonic@users.sf.net>
Date:   Fri Apr 5 22:03:56 2013 +0200

    videoscale: set min value to DBL_MIN to avoid a value of 0.0 that would crash
Comment 6 David Schleef 2013-04-05 21:01:04 UTC
Reopening, as this needs more thought.  The fix is fine for now, of course.
Comment 7 David Schleef 2013-04-06 20:42:29 UTC
commit c07efdabd8fcf02f100c9810a7a99a367dea4b34
Author: David Schleef <ds@schleef.org>
Date:   Sat Apr 6 13:00:02 2013 -0700

    videoscale: set reasonable limits on properties
    
    Properties sharpen, sharpness, and envelope are only useful
    near their default values.  Decrease ranges to avoid brokenness.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=682171