[FFmpeg-cvslog] ra144: fix code with ftrapv.

Michael Niedermayer git at videolan.org
Tue Oct 9 06:19:18 CEST 2012


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Tue Oct  9 05:55:40 2012 +0200| [1e83e6ad7a8b5d6994c50f531c30f25f787f0c0e] | committer: Michael Niedermayer

ra144: fix code with ftrapv.

A better solution is welcome!

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=1e83e6ad7a8b5d6994c50f531c30f25f787f0c0e
---

 libavcodec/ra144.c |    8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/libavcodec/ra144.c b/libavcodec/ra144.c
index aa68378..3b24740 100644
--- a/libavcodec/ra144.c
+++ b/libavcodec/ra144.c
@@ -1567,8 +1567,14 @@ int ff_eval_refl(int *refl, const int16_t *coefs, AVCodecContext *avctx)
             b = -2;
 
         b = 0x1000000 / b;
-        for (j=0; j <= i; j++)
+        for (j=0; j <= i; j++) {
+#if CONFIG_FTRAPV
+            int a = bp2[j] - ((refl[i+1] * bp2[i-j]) >> 12);
+            if((int)(a*(unsigned)b) != a*(int64_t)b)
+                return 1;
+#endif
             bp1[j] = ((bp2[j] - ((refl[i+1] * bp2[i-j]) >> 12)) * b) >> 12;
+        }
 
         if ((unsigned) bp1[i] + 0x1000 > 0x1fff)
             return 1;



More information about the ffmpeg-cvslog mailing list