GNOME Bugzilla – Bug 743907
exclusion: crash with factor=0
Last modified: 2015-05-26 13:18:48 UTC
When factor property is set to 0, exception occurs. This happens due to divide by zero errors in calculations. factor property can never be 0. Hence adjusting the minimum value to 1.
Created attachment 295993 [details] [review] fix exception when factor is 0
Can someone review this :)
I don't understand why this is needed. gst-launch-1.0 videotestsrc ! exclusion factor=0 ! ximagesink works just fine for me (well, it shows a black image anyway) and the code has if (G_UNLIKELY (factor == 0)) return; so it seems to be an intentionally allowed value. Could you explain what goes wrong for you? What "exception" occurs?
Hi Tim, This got fixed in a different way with commit 30780db15bf8af3ee9dcf9ccb9e9bb5643b39d2a. Now it does not crash. But not sure which way of fixing is good? If you feel the commit mentioned above is good then we can resolve it as fixed.
Ah, sorry, I missed that it had been fixed already. I have no opinion which solution is better, take it up with Luis if you want :) commit 30780db15bf8af3ee9dcf9ccb9e9bb5643b39d2a Author: Luis de Bethencourt <luis.bg@samsung.com> Date: Wed Apr 22 14:30:56 2015 +0100 gaudi: fix exclusion's factor range Avoid dividing by zero when the factor is zero. Instead, output a buffer with all color values as zero.
Sorry Vineeth. I fixed this bug before I saw your fix. I prefer yours to mine, so I will merge it.
Review of attachment 295993 [details] [review]: commit 5985bc4b05e13231d058e041d9317e6f7c7f3625