# HG changeset patch # User mru # Date 1282236686 0 # Node ID 4be72e19ab0ef9d122c6dc84e277f68aa1c3d41a # Parent 21133d90ecf21a0367f93626d2b9de4ffb659dcb imc: fix undefined float to int conversion Conversion of an out of range float to int is undefined. Clipping to the final range first avoids such problems. This fixes decoding on MIPS, which handles these conversions differently from many other CPUs. diff -r 21133d90ecf2 -r 4be72e19ab0e imc.c --- a/imc.c Wed Aug 18 13:50:32 2010 +0000 +++ b/imc.c Thu Aug 19 16:51:26 2010 +0000 @@ -362,7 +362,7 @@ iacc = 0; for(j = (stream_format_code & 0x2)?4:0; j < BANDS; j++) { - cwlen = av_clip((int)((q->flcoeffs4[j] * 0.5) - summa + 0.5), 0, 6); + cwlen = av_clipf(((q->flcoeffs4[j] * 0.5) - summa + 0.5), 0, 6); q->bitsBandT[j] = cwlen; summer += q->bandWidthT[j] * cwlen;