linphone-developers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Linphone-developers] A endless loop bug in ortp-0.18.0


From: 吕红亚
Subject: [Linphone-developers] A endless loop bug in ortp-0.18.0
Date: Sat, 14 Jan 2012 10:59:08 +0800

I have find a bug in the ortp-0.18.0.
 
the functhion  "count_power_items_fast" in the file "sessionset.c" line 59.
 
the original function defination is :
int count_power_items_fast(int v) //i think v shoud be uint32_t
{
    int c = 0;
    while(v) {
        c += (v & 1);
   v >>= 1;
    }
    return c;
}
 
In this function the parameter "v" is int ,So if the "v" is <0 (negative),and v>>=1(arithmetic shift right),the parameter "v" will always negative and never be zero,and then this function will never end.
 
So i think shoud change the parameter "v" to uint32_t, the when v>>=1 while be logical shift right.
 
thanks for your attention.
 
2012-01-14

Andy 

reply via email to

[Prev in Thread] Current Thread [Next in Thread]