ARLM-Keller / aforge

Automatically exported from code.google.com/p/aforge
0 stars 0 forks source link

Division by zero #114

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
First sorry for my english.

I am doing test with GestureRecognition, I am showing in real time the 
histogram in the left side of me videosourceplayer, the histogram is showing 
correctly but when i do not move, the histogram should be disappears, and is 
when crash because max is zero and is doing division by zero.

// scaling factor
double factor = (double) ( ( vertical ) ? width : height ) / ( ( logarithmic 
) ? maxLogarithmic : max );

line 355, 356, 357 AForge.Controls.Histogram.cs

Original issue reported on code.google.com by sotoisra24 on 2 Dec 2009 at 2:39

GoogleCodeExporter commented 8 years ago
Added check for max equals to zero to avoid painting histogram when there is 
nothing 
to paint actually.

Committed in revision 1150. Will be released in 2.1.x.

Original comment by andrew.k...@gmail.com on 16 Dec 2009 at 12:40

GoogleCodeExporter commented 8 years ago

Original comment by andrew.k...@gmail.com on 24 Jan 2010 at 2:31