aboutsummaryrefslogtreecommitdiffhomepage
path: root/libaf
diff options
context:
space:
mode:
authorGravatar uau <uau@b3059339-0415-0410-9bf9-f77b7e298cf2>2006-09-18 14:04:50 +0000
committerGravatar uau <uau@b3059339-0415-0410-9bf9-f77b7e298cf2>2006-09-18 14:04:50 +0000
commit203d12891800e657cfe88589bf267b22e54edfa2 (patch)
tree2d1cf1e0ab539743b2ab4d8b8a4c76911691a98b /libaf
parent821b4a2dc7a79a1e8b3f21f46334ce72d7c7764f (diff)
Fix stupid use of multiplication to check signs which fails because of
overflow. Negative values do not seem to be used so just remove the failing test. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@19889 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libaf')
-rw-r--r--libaf/af.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/libaf/af.c b/libaf/af.c
index bae66ce8b0..ba5d59da14 100644
--- a/libaf/af.c
+++ b/libaf/af.c
@@ -650,11 +650,9 @@ af_instance_t *af_control_any_rev (af_stream_t* s, int cmd, void* arg) {
* \brief calculate greatest common divisior of a and b.
* \ingroup af_filter
*
- * Extended for negative and 0 values. If both are 0 the result is 1.
- * The sign of the result will be so that it has the same sign as b.
+ * If both are 0 the result is 1.
*/
int af_gcd(register int a, register int b) {
- int b_org = b;
while (b != 0) {
a %= b;
if (a == 0)
@@ -665,8 +663,6 @@ int af_gcd(register int a, register int b) {
a += b;
if (!a)
return 1;
- if (a * b_org < 0)
- return -a;
return a;
}