[FFmpeg-cvslog] avcodec/dirac_arith: Fix build with PIC and stack-check options

Anthoine Bourgeois git at videolan.org
Mon Jun 23 17:55:51 CEST 2014


ffmpeg | branch: release/2.1 | Anthoine Bourgeois <anthoine.bourgeois at gmail.com> | Wed Apr  9 12:18:32 2014 +0200| [26d72b3df0ce82fed64dfcbc0889bf5b89b9c295] | committer: Michael Niedermayer

avcodec/dirac_arith: Fix build with PIC and stack-check options

Fixes Ticket3540

The function dirac_get_arith_bit in libavcodec/dirac_arith.h can't be
built with PIC and check-stack because the asm code needs 6 registers
and PIC and check-stack options take 1 each and x86 is quite limited
in this area.

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
(cherry picked from commit d8ab7f31dd819f7b3e0d460a2fa4261aaae87b98)

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

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

 libavcodec/dirac_arith.h |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libavcodec/dirac_arith.h b/libavcodec/dirac_arith.h
index f9a8bba..089c71a 100644
--- a/libavcodec/dirac_arith.h
+++ b/libavcodec/dirac_arith.h
@@ -28,6 +28,7 @@
 #ifndef AVCODEC_DIRAC_ARITH_H
 #define AVCODEC_DIRAC_ARITH_H
 
+#include "libavutil/x86/asm.h"
 #include "bytestream.h"
 #include "get_bits.h"
 
@@ -134,7 +135,7 @@ static inline int dirac_get_arith_bit(DiracArith *c, int ctx)
 
     range_times_prob = (c->range * prob_zero) >> 16;
 
-#if HAVE_FAST_CMOV && HAVE_INLINE_ASM
+#if HAVE_FAST_CMOV && HAVE_INLINE_ASM && HAVE_6REGS
     low   -= range_times_prob << 16;
     range -= range_times_prob;
     bit = 0;



More information about the ffmpeg-cvslog mailing list