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 743907 - exclusion: crash with factor=0
exclusion: crash with factor=0
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
unspecified
Other Linux
: Normal minor
: 1.5.1
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2015-02-03 05:10 UTC by Vineeth
Modified: 2015-05-26 13:18 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
fix exception when factor is 0 (1.17 KB, patch)
2015-02-03 05:11 UTC, Vineeth
committed Details | Review

Description Vineeth 2015-02-03 05:10:26 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.
Comment 1 Vineeth 2015-02-03 05:11:30 UTC
Created attachment 295993 [details] [review]
fix exception when factor is 0
Comment 2 Vineeth 2015-05-20 10:29:37 UTC
Can someone review this :)
Comment 3 Tim-Philipp Müller 2015-05-22 16:46:11 UTC
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?
Comment 4 Vineeth 2015-05-25 23:43:02 UTC
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.
Comment 5 Tim-Philipp Müller 2015-05-26 07:31:32 UTC
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.
Comment 6 Luis de Bethencourt 2015-05-26 13:10:12 UTC
Sorry Vineeth. I fixed this bug before I saw your fix. I prefer yours to mine, so I will merge it.
Comment 7 Luis de Bethencourt 2015-05-26 13:18:48 UTC
Review of attachment 295993 [details] [review]:

commit 5985bc4b05e13231d058e041d9317e6f7c7f3625