]> git.sesse.net Git - ffmpeg/blobdiff - configure
swscale: fix integer overflows in RGB pixel writing.
[ffmpeg] / configure
index 57630f2a5350f2c1cc84167d543e345fa885e0f2..22542afbe7c275ae1ef166c498d9c51dadd1e24f 100755 (executable)
--- a/configure
+++ b/configure
@@ -113,6 +113,9 @@ Configuration options:
   --disable-dxva2          disable DXVA2 code
   --enable-runtime-cpudetect detect cpu capabilities at runtime (bigger binary)
   --enable-hardcoded-tables use hardcoded tables instead of runtime generation
+  --disable-safe-bitstream-reader
+                           disable buffer boundary checking in bitreaders
+                           (faster, but may crash)
   --enable-memalign-hack   emulate memalign, interferes with memory debuggers
   --disable-everything     disable all components listed below
   --disable-encoder=NAME   disable encoder NAME
@@ -903,8 +906,17 @@ COMPONENT_LIST="
     protocols
 "
 
+PROGRAM_LIST="
+    avconv
+    avplay
+    avprobe
+    avserver
+    ffmpeg
+"
+
 CONFIG_LIST="
     $COMPONENT_LIST
+    $PROGRAM_LIST
     aandct
     ac3dsp
     avcodec
@@ -918,17 +930,13 @@ CONFIG_LIST="
     dwt
     dxva2
     fastdiv
-    ffmpeg
-    avconv
-    avplay
-    avprobe
-    avserver
     fft
     frei0r
     gnutls
     golomb
     gpl
     gray
+    h264chroma
     h264dsp
     h264pred
     hardcoded_tables
@@ -971,6 +979,7 @@ CONFIG_LIST="
     rdft
     rtpdec
     runtime_cpudetect
+    safe_bitstream_reader
     shared
     sinewin
     small
@@ -1053,15 +1062,14 @@ HAVE_LIST="
     asm_mod_y
     attribute_may_alias
     attribute_packed
-    bswap
     closesocket
     cmov
     dcbzl
     dev_bktr_ioctl_bt848_h
     dev_bktr_ioctl_meteor_h
     dev_ic_bt8xx_h
-    dev_video_meteor_ioctl_meteor_h
     dev_video_bktr_ioctl_bt848_h
+    dev_video_meteor_ioctl_meteor_h
     dlfcn_h
     dlopen
     dos_paths
@@ -1080,7 +1088,6 @@ HAVE_LIST="
     GetProcessTimes
     getrusage
     gnu_as
-    struct_rusage_ru_maxrss
     ibm_asm
     inet_aton
     inline_asm
@@ -1106,28 +1113,29 @@ HAVE_LIST="
     memalign
     mkstemp
     mmap
+    poll_h
     posix_memalign
     round
     roundf
     sdl
     sdl_video_size
     setmode
+    setrlimit
     sndio_h
     socklen_t
     soundcard_h
-    poll_h
-    setrlimit
     strerror_r
     strptime
     strtok_r
     struct_addrinfo
     struct_ipv6_mreq
+    struct_rusage_ru_maxrss
     struct_sockaddr_in6
     struct_sockaddr_sa_len
     struct_sockaddr_storage
     symver
-    symver_gnu_asm
     symver_asm_label
+    symver_gnu_asm
     sys_mman_h
     sys_resource_h
     sys_select_h
@@ -1242,8 +1250,8 @@ fast_64bit_if_any="alpha ia64 mips64 parisc64 ppc64 sparc64 x86_64"
 fast_clz_if_any="alpha armv5te avr32 mips ppc x86"
 fast_unaligned_if_any="armv6 ppc x86"
 
-need_memalign="altivec neon sse"
 inline_asm_deps="!tms470"
+need_memalign="altivec neon sse"
 
 symver_if_any="symver_asm_label symver_gnu_asm"
 
@@ -1293,7 +1301,7 @@ h263_encoder_select="aandct"
 h263_vaapi_hwaccel_select="vaapi h263_decoder"
 h263i_decoder_select="h263_decoder"
 h263p_encoder_select="h263_encoder"
-h264_decoder_select="golomb h264dsp h264pred"
+h264_decoder_select="golomb h264chroma h264dsp h264pred"
 h264_dxva2_hwaccel_deps="dxva2api_h"
 h264_dxva2_hwaccel_select="dxva2 h264_decoder"
 h264_vaapi_hwaccel_select="vaapi h264_decoder"
@@ -1307,28 +1315,28 @@ loco_decoder_select="golomb"
 mjpeg_encoder_select="aandct"
 mlp_decoder_select="mlp_parser"
 mp1_decoder_select="mpegaudiodsp"
-mp2_decoder_select="mpegaudiodsp"
-mp3adu_decoder_select="mpegaudiodsp"
-mp3_decoder_select="mpegaudiodsp"
-mp3on4_decoder_select="mpegaudiodsp"
 mp1float_decoder_select="mpegaudiodsp"
+mp2_decoder_select="mpegaudiodsp"
 mp2float_decoder_select="mpegaudiodsp"
+mp3_decoder_select="mpegaudiodsp"
+mp3adu_decoder_select="mpegaudiodsp"
 mp3adufloat_decoder_select="mpegaudiodsp"
 mp3float_decoder_select="mpegaudiodsp"
+mp3on4_decoder_select="mpegaudiodsp"
 mp3on4float_decoder_select="mpegaudiodsp"
-mpeg1video_encoder_select="aandct"
-mpeg2video_encoder_select="aandct"
-mpeg4_decoder_select="h263_decoder mpeg4video_parser"
-mpeg4_encoder_select="h263_encoder"
 mpeg_vdpau_decoder_select="vdpau mpegvideo_decoder"
+mpeg_xvmc_decoder_deps="X11_extensions_XvMClib_h"
+mpeg_xvmc_decoder_select="mpegvideo_decoder"
 mpeg1_vdpau_decoder_select="vdpau mpeg1video_decoder"
+mpeg1video_encoder_select="aandct"
 mpeg2_dxva2_hwaccel_deps="dxva2api_h"
 mpeg2_dxva2_hwaccel_select="dxva2 mpeg2video_decoder"
 mpeg2_vaapi_hwaccel_select="vaapi mpeg2video_decoder"
+mpeg2video_encoder_select="aandct"
+mpeg4_decoder_select="h263_decoder mpeg4video_parser"
+mpeg4_encoder_select="h263_encoder"
 mpeg4_vaapi_hwaccel_select="vaapi mpeg4_decoder"
 mpeg4_vdpau_decoder_select="vdpau mpeg4_decoder"
-mpeg_xvmc_decoder_deps="X11_extensions_XvMClib_h"
-mpeg_xvmc_decoder_select="mpegvideo_decoder"
 msmpeg4v1_decoder_select="h263_decoder"
 msmpeg4v1_encoder_select="h263_encoder"
 msmpeg4v2_decoder_select="h263_decoder"
@@ -1346,14 +1354,14 @@ rv10_decoder_select="h263_decoder"
 rv10_encoder_select="h263_encoder"
 rv20_decoder_select="h263_decoder"
 rv20_encoder_select="h263_encoder"
-rv30_decoder_select="golomb h264pred"
-rv40_decoder_select="golomb h264pred"
+rv30_decoder_select="golomb h264chroma h264pred"
+rv40_decoder_select="golomb h264chroma h264pred"
 shorten_decoder_select="golomb"
 sipr_decoder_select="lsp"
 snow_decoder_select="dwt"
 snow_encoder_select="aandct dwt"
 svq1_encoder_select="aandct"
-svq3_decoder_select="golomb h264dsp h264pred"
+svq3_decoder_select="golomb h264chroma h264dsp h264pred"
 svq3_decoder_suggest="zlib"
 theora_decoder_select="vp3_decoder"
 tiff_decoder_suggest="zlib"
@@ -1361,7 +1369,7 @@ tiff_encoder_suggest="zlib"
 truehd_decoder_select="mlp_decoder"
 tscc_decoder_select="zlib"
 twinvq_decoder_select="mdct lsp sinewin"
-vc1_decoder_select="h263_decoder"
+vc1_decoder_select="h263_decoder h264chroma"
 vc1_dxva2_hwaccel_deps="dxva2api_h DXVA_PictureParameters_wDecodedPictureIndex"
 vc1_dxva2_hwaccel_select="dxva2 vc1_decoder"
 vc1_vaapi_hwaccel_select="vaapi vc1_decoder"
@@ -1398,7 +1406,7 @@ vda_deps="VideoDecodeAcceleration_VDADecoder_h pthreads"
 vdpau_deps="vdpau_vdpau_h vdpau_vdpau_x11_h"
 
 # parsers
-h264_parser_select="golomb h264dsp h264pred"
+h264_parser_select="golomb h264chroma h264dsp h264pred"
 
 # external libraries
 libdirac_decoder_deps="libdirac !libschroedinger"
@@ -1514,8 +1522,6 @@ avformat_deps="avcodec"
 postproc_deps="gpl"
 
 # programs
-ffmpeg_deps="avcodec avformat swscale"
-ffmpeg_select="buffer_filter"
 avconv_deps="avcodec avformat swscale"
 avconv_select="buffer_filter"
 avplay_deps="avcodec avformat swscale sdl"
@@ -1523,6 +1529,8 @@ avplay_select="rdft"
 avprobe_deps="avcodec avformat"
 avserver_deps="avformat ffm_muxer fork rtp_protocol rtsp_demuxer"
 avserver_extralibs='$ldl'
+ffmpeg_deps="avcodec avformat swscale"
+ffmpeg_select="buffer_filter"
 
 doc_deps="texi2html"
 
@@ -1545,7 +1553,6 @@ mxf_d10_test_deps="avfilter"
 seek_lavf_mxf_d10_test_deps="mxf_d10_test"
 
 test_deps _encoder _decoder                                             \
-    adpcm_g726=g726                                                     \
     adpcm_ima_qt                                                        \
     adpcm_ima_wav                                                       \
     adpcm_ms                                                            \
@@ -1561,6 +1568,7 @@ test_deps _encoder _decoder                                             \
     flac                                                                \
     flashsv                                                             \
     flv                                                                 \
+    adpcm_g726=g726                                                     \
     gif                                                                 \
     h261                                                                \
     h263="h263 h263p"                                                   \
@@ -1646,9 +1654,9 @@ objformat="elf"
 pkg_config_default=pkg-config
 ranlib="ranlib"
 yasmexe="yasm"
-nogas=":"
 
 nm_opts='-g'
+nogas=":"
 
 # machine
 arch_default=$(uname -m)
@@ -1659,26 +1667,24 @@ target_os_default=$(tolower $(uname -s))
 host_os=$target_os_default
 
 # configurable options
+enable $PROGRAM_LIST
+
 enable avcodec
 enable avdevice
 enable avfilter
 enable avformat
 enable avutil
+enable postproc
+enable swscale
+
 enable asm
 enable debug
 enable doc
 enable fastdiv
-enable ffmpeg
-enable avconv
-enable avplay
-enable avprobe
-enable avserver
 enable network
 enable optimizations
-enable postproc
-enable protocols
+enable safe_bitstream_reader
 enable static
-enable swscale
 enable swscale_alpha
 
 # build settings
@@ -1747,6 +1753,20 @@ INDEV_LIST=$(find_things    indev    _IN      libavdevice/alldevices.c)
 PROTOCOL_LIST=$(find_things protocol PROTOCOL libavformat/allformats.c)
 FILTER_LIST=$(find_things   filter   FILTER   libavfilter/allfilters.c)
 
+ALL_COMPONENTS="
+    $BSF_LIST
+    $DECODER_LIST
+    $DEMUXER_LIST
+    $ENCODER_LIST
+    $FILTER_LIST
+    $HWACCEL_LIST
+    $INDEV_LIST
+    $MUXER_LIST
+    $OUTDEV_LIST
+    $PARSER_LIST
+    $PROTOCOL_LIST
+"
+
 find_tests(){
     map "echo ${2}\${v}_test" $(ls "$source_path"/tests/ref/$1 | grep -v '[^-a-z0-9_]')
 }
@@ -1757,6 +1777,8 @@ LAVF_TESTS=$(find_tests lavf)
 LAVFI_TESTS=$(find_tests lavfi)
 SEEK_TESTS=$(find_tests seek seek_)
 
+ALL_TESTS="$ACODEC_TESTS $VCODEC_TESTS $LAVF_TESTS $LAVFI_TESTS $SEEK_TESTS"
+
 pcm_test_deps=$(map 'echo ${v%_*}_decoder $v' $(filter pcm_* $ENCODER_LIST))
 
 for n in $COMPONENT_LIST; do
@@ -1765,7 +1787,7 @@ for n in $COMPONENT_LIST; do
     eval ${n}_if_any="\$$v"
 done
 
-enable $ARCH_EXT_LIST $ACODEC_TESTS $VCODEC_TESTS $LAVF_TESTS $LAVFI_TESTS $SEEK_TESTS
+enable $ARCH_EXT_LIST $ALL_TESTS
 
 die_unknown(){
     echo "Unknown option \"$1\"."
@@ -1898,14 +1920,14 @@ tmpfile(){
 
 trap 'rm -f -- $TMPFILES' EXIT
 
-tmpfile TMPC  .c
-tmpfile TMPE  $EXESUF
-tmpfile TMPH  .h
-tmpfile TMPO  .o
-tmpfile TMPS  .S
-tmpfile TMPV  .ver
-tmpfile TMPSH .sh
 tmpfile TMPASM .asm
+tmpfile TMPC   .c
+tmpfile TMPE   $EXESUF
+tmpfile TMPH   .h
+tmpfile TMPO   .o
+tmpfile TMPS   .S
+tmpfile TMPSH  .sh
+tmpfile TMPV   .ver
 
 unset -f mktemp
 
@@ -1924,9 +1946,9 @@ EOF
     die "Sanity test failed."
 fi
 
+filter_asflags=echo
 filter_cflags=echo
 filter_cppflags=echo
-filter_asflags=echo
 
 if   $cc -v 2>&1 | grep -q '^gcc.*LLVM'; then
     cc_type=llvm_gcc
@@ -2741,8 +2763,6 @@ EOF
     enabled ssse3 && check_asm ssse3 '"pabsw %xmm0, %xmm0"'
     enabled mmx2  && check_asm mmx2  '"pmaxub %mm0, %mm1"'
 
-    check_asm bswap '"bswap %%eax" ::: "%eax"'
-
     if ! disabled_any asm mmx yasm; then
         if check_cmd $yasmexe --version; then
             enabled x86_64 && yasm_extra="-m amd64"
@@ -3002,7 +3022,7 @@ check_func XFixesGetCursorImage -lX11 -lXext -lXfixes
 
 # check for VDA header
 if ! disabled vda && check_header VideoDecodeAcceleration/VDADecoder.h; then
-    enable vda && add_ldflags -framework CoreFoundation -framework VideoDecodeAcceleration -framework QuartzCore
+    enable vda && add_extralibs -framework CoreFoundation -framework VideoDecodeAcceleration -framework QuartzCore
 fi
 
 if ! disabled vdpau && enabled vdpau_vdpau_h; then
@@ -3120,22 +3140,8 @@ enabled_any $THREADS_LIST      && enable threads
 check_deps $CONFIG_LIST       \
            $CONFIG_EXTRA      \
            $HAVE_LIST         \
-           $DECODER_LIST      \
-           $ENCODER_LIST      \
-           $HWACCEL_LIST      \
-           $PARSER_LIST       \
-           $BSF_LIST          \
-           $DEMUXER_LIST      \
-           $MUXER_LIST        \
-           $FILTER_LIST       \
-           $INDEV_LIST        \
-           $OUTDEV_LIST       \
-           $PROTOCOL_LIST     \
-           $ACODEC_TESTS      \
-           $VCODEC_TESTS      \
-           $LAVF_TESTS        \
-           $LAVFI_TESTS       \
-           $SEEK_TESTS        \
+           $ALL_COMPONENTS    \
+           $ALL_TESTS         \
 
 enabled asm || { arch=c; disable $ARCH_LIST $ARCH_EXT_LIST; }
 
@@ -3339,13 +3345,13 @@ get_version(){
     eval echo "${lcname}_VERSION_MAJOR=\$${name}_VERSION_MAJOR" >> config.mak
 }
 
-get_version LIBSWSCALE  libswscale/swscale.h
-get_version LIBPOSTPROC libpostproc/postprocess.h
 get_version LIBAVCODEC  libavcodec/version.h
 get_version LIBAVDEVICE libavdevice/avdevice.h
+get_version LIBAVFILTER libavfilter/avfilter.h
 get_version LIBAVFORMAT libavformat/version.h
 get_version LIBAVUTIL   libavutil/avutil.h
-get_version LIBAVFILTER libavfilter/avfilter.h
+get_version LIBPOSTPROC libpostproc/postprocess.h
+get_version LIBSWSCALE  libswscale/swscale.h
 
 cat > $TMPH <<EOF
 /* Automatically generated by configure - do not modify! */
@@ -3383,17 +3389,7 @@ print_config ARCH_   "$config_files" $ARCH_LIST
 print_config HAVE_   "$config_files" $HAVE_LIST
 print_config CONFIG_ "$config_files" $CONFIG_LIST       \
                                      $CONFIG_EXTRA      \
-                                     $DECODER_LIST      \
-                                     $ENCODER_LIST      \
-                                     $HWACCEL_LIST      \
-                                     $PARSER_LIST       \
-                                     $BSF_LIST          \
-                                     $DEMUXER_LIST      \
-                                     $MUXER_LIST        \
-                                     $FILTER_LIST       \
-                                     $PROTOCOL_LIST     \
-                                     $INDEV_LIST        \
-                                     $OUTDEV_LIST       \
+                                     $ALL_COMPONENTS    \
 
 cat >>config.mak <<EOF
 ACODEC_TESTS=$(print_enabled -n _test $ACODEC_TESTS)