mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-11-21 10:55:51 +02:00
overflow fix
Originally committed as revision 3250 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
parent
57c4d4051e
commit
8176bd1a46
@ -68,9 +68,10 @@ static uint64_t log16(uint64_t a){
|
||||
a<<=16;
|
||||
|
||||
for(i=19;i>=0;i--){
|
||||
if(a<(exp16_table[i]<<16)) continue;
|
||||
int64_t b= exp16_table[i];
|
||||
if(a<(b<<16)) continue;
|
||||
out |= 1<<i;
|
||||
a = ((a<<16) + exp16_table[i]/2)/exp16_table[i];
|
||||
a = ((a/b)<<16) + (((a%b)<<16) + b/2)/b;
|
||||
}
|
||||
return out;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user