[MPlayer-cvslog] r19889 - trunk/libaf/af.c

uau subversion at mplayerhq.hu
Mon Sep 18 16:04:50 CEST 2006


Author: uau
Date: Mon Sep 18 16:04:50 2006
New Revision: 19889

Modified:
   trunk/libaf/af.c

Log:
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.


Modified: trunk/libaf/af.c
==============================================================================
--- trunk/libaf/af.c	(original)
+++ trunk/libaf/af.c	Mon Sep 18 16:04:50 2006
@@ -650,11 +650,9 @@
  * \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 @@
   a += b;
   if (!a)
     return 1;
-  if (a * b_org < 0)
-    return -a;
   return a;
 }
 



More information about the MPlayer-cvslog mailing list