1
mirror of https://git.videolan.org/git/ffmpeg.git synced 2024-09-16 20:00:29 +02:00
Commit Graph

82850 Commits

Author SHA1 Message Date
Muhammad Faiz
2b0112d42d swresample/resample: remove swri_resample function
integrate it inside multiple_resample
allow some calculations to be performed outside loop

Suggested-by: Michael Niedermayer <michael@niedermayer.cc>
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Muhammad Faiz <mfcc64@gmail.com>
2016-12-14 06:48:34 +07:00
Alex Converse
bf15981b12 libvpxenc: Don't spam level errors for VP8 encodes
Fixes "Failed to set VP9E_GET_LEVEL codec control: Codec does not
implement requested capability" log messages on VP8 encodes.
2016-12-13 10:43:57 -08:00
Muhammad Faiz
6a8c0d8357 swresample/resample: do not allow negative dst_size return value
This should fix Ticket6012

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Muhammad Faiz <mfcc64@gmail.com>
2016-12-14 00:43:44 +07:00
Michael Niedermayer
f0bdd53871 avformat/utils: Print verbose error message if stream count exceeds max_streams
Reviewed-by: Andreas Cadhalpun <andreas.cadhalpun@googlemail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-12-13 15:55:42 +01:00
Michael Niedermayer
30581c51e7 avformat/options_table: Set the default maximum number of streams to 1000
Fixes CVE-2016-9561, Note the security relevance of this is disputed as
running out of memory can happen with valid files

Suggested-by: Andreas Cadhalpun <andreas.cadhalpun@googlemail.com>
Reviewed-by: Andreas Cadhalpun <andreas.cadhalpun@googlemail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-12-13 15:55:42 +01:00
Marton Balint
265d45183b avfilter/avfilter: fix filtering frames with unknown channel layouts for filters needing writable frames
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Marton Balint <cus@passwd.hu>
2016-12-13 09:57:10 +01:00
Zhou Xiaoyong
d84e635d06 avcodec/mips: version 1 of wmv2dsp optimizations for loongson mmi
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-12-13 03:47:04 +01:00
Zhou Xiaoyong
c5c6e30781 avcodec/mips: version 1 of vp8dsp optimizations for loongson mmi
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-12-13 03:47:04 +01:00
Wan-Teh Chang
3f55752cd5 configure: add -fPIE instead of -pie to C flags for ThreadSanitizer
-pie was added to C flags for ThreadSanitizer in commit
19f251a288. Under clang 3.8.0, the -pie
flag causes a compiler warning and a linker error when running configure
--toolchain=clang-tsan. Here is an excerpt from config.log:

clang ... -fsanitize=thread -pie -std=c11 -fomit-frame-pointer -pthread -c -o /tmp/ffconf.hL61stP9.o /tmp/ffconf.YO6ZaSFG.c
clang: warning: argument unused during compilation: '-pie'
clang -fsanitize=thread -pie -Wl,--as-needed -Wl,-z,noexecstack -o /tmp/ffconf.W5c2e41l /tmp/ffconf.hL61stP9.o -lbz2 -pthread
/usr/bin/ld: /tmp/ffconf.hL61stP9.o: relocation R_X86_64_PC32 against undefined symbol `atan2f@@GLIBC_2.2.5' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: final link failed: Bad value
clang: error: linker command failed with exit code 1 (use -v to see invocation)

To be conservative, I changed -pie to -fPIE. But the documentation seems
to imply just -fsanitize=thread is enough:

http://clang.llvm.org/docs/ThreadSanitizer.html
https://github.com/google/sanitizers/wiki/ThreadSanitizerCppManual

Signed-off-by: Wan-Teh Chang <wtc@google.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-12-13 00:41:39 +01:00
Wan-Teh Chang
fed50c4304 avutil: fix data race in av_get_cpu_flags()
Make the one-time initialization in av_get_cpu_flags() thread-safe. The
static variable |cpu_flags| in libavutil/cpu.c is read and written using
normal load and store operations. These are considered as data races.
The fix is to use atomic load and store operations.

The fix can be verified by running the libavutil/tests/cpu_init.c test
program under ThreadSanitizer:
    ./configure --toolchain=clang-tsan
    make libavutil/tests/cpu_init
    libavutil/tests/cpu_init

There should be no warnings from ThreadSanitizer.

Co-author: Dmitry Vyukov of Google, who suggested the data race fix.

Signed-off-by: Wan-Teh Chang <wtc@google.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-12-13 00:07:20 +01:00
Michael Niedermayer
4cf3def805 avutil/tests/imgutils: Remove unused variable
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-12-13 00:06:53 +01:00
Andreas Cadhalpun
3ab8436ff6 opt: reject denominator zero as out of range
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2016-12-13 00:00:31 +01:00
Derek Buitenhuis
b7e4ea0c80 fate: Add h264 test for frame num gaps
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2016-12-12 13:33:52 +00:00
Timo Rothenpieler
00223132e9 avcodec/cuvid: fix compilation with msvc11 2016-12-12 13:09:55 +01:00
Carl Eugen Hoyos
62eafc6a6d lavf/mov: Accept multiple fourcc for AVID 1:1.
Fixes ticket #5982.
2016-12-12 12:26:21 +01:00
Carl Eugen Hoyos
9d068896d3 lavf/isom: Support EVRC in pvAuthor files.
Fixes ticket #6014.
2016-12-12 11:37:06 +01:00
James Almer
edb4f5da81 avformat/matroskadec: remove the strict unofficial check for Colour elements
Signed-off-by: James Almer <jamrial@gmail.com>
2016-12-10 21:06:45 -03:00
James Almer
4e759072c2 avformat/matroskadec: allocate Colour related fields only if the file contains the relevant master
The demuxer doesn't fill the defaults if the master isn't present.
This results in codecpar->color_space being set with a value of
zero (RGB) on such files.

Signed-off-by: James Almer <jamrial@gmail.com>
2016-12-10 21:05:21 -03:00
Marton Balint
1f3910262e ffplay: fix sws_scale possible out of bounds array access
As I used simple RGBA formats for subtitles and for the video texture if
avfilter is disabled I kind of assumed that sws_scale won't access data
pointers and strides above index 0, but apparently that is not the case.

Fixes Coverity CID 1396737, 1396738, 1396739, 1396740.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Marton Balint <cus@passwd.hu>
2016-12-10 23:22:11 +01:00
Wan-Teh Chang
3703f13333 avutil/tests: run the cpu_init.c test conditionally on HAVE_THREADS
Suggested by Diego Biurrun and James Almer.

Signed-off-by: Wan-Teh Chang <wtc@google.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2016-12-10 18:47:10 -03:00
Wan-Teh Chang
8986885801 avutil/cpu_init: remove unnecessary arguments to the main() function
Signed-off-by: James Almer <jamrial@gmail.com>
2016-12-10 18:47:00 -03:00
Michael Niedermayer
2f07830e69 avcodec: Add max_pixels options
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-12-10 22:24:10 +01:00
Michael Niedermayer
f542b152aa avutil: Add av_image_check_size2()
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-12-10 22:24:10 +01:00
Michael Niedermayer
1b39a30247 fate: add av_image_check_size() test
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-12-10 22:24:10 +01:00
Andreas Cadhalpun
8aad209c13 configure: fail if autodetect-libraries are requested but not found
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2016-12-10 19:29:37 +01:00
Andreas Cadhalpun
4c45566493 configure: enable autodetected libraries after option parsing
And only enable them, if they haven't been disabled.

This is needed for the following patch.

Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2016-12-10 19:29:37 +01:00
Andreas Cadhalpun
c50d591ce2 configure: enable sdl if sdl2 is enabled
sdl is supposed to be an alias, so it should have the same value.

Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2016-12-10 19:29:37 +01:00
Derek Buitenhuis
51c673a0d7 libavcodec/tests: Add avpacket test to .gitignore
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2016-12-10 15:51:01 +00:00
Mark Thompson
db7271bff2 configure: Require bit_depth field for VAAPI VP9 decode hwaccel
libva versions from 1.6.0 to 1.6.2 do not include it, and therefore
cannot work with VP9 profile >= 2.

Fixes ticket #6003.
2016-12-10 13:53:30 +00:00
Andreas Cadhalpun
c085f1a7e1 opus_parser: make ParseContext the first element in OpusParseContext
ff_parse_close expects priv_data to be the ParseContext directly and
thus doesn't work if it isn't at the beginning of OpusParseContext.

Reviewed-by: Hendrik Leppkes <h.leppkes@gmail.com>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2016-12-10 13:36:57 +01:00
Andreas Cadhalpun
7d3baebe40 opus_parser: fix leaking channel_maps on error
Make ff_opus_parse_extradata free allocated memory on error instead of
expecting callers to free it in that case.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2016-12-10 13:36:12 +01:00
Marton Balint
df694a5e9d avfilter/af_ashowinfo: properly show input channel layout for unknown channel layouts
Reviewed-by: Nicolas George <george@nsup.org>
Signed-off-by: Marton Balint <cus@passwd.hu>
2016-12-10 11:57:12 +01:00
Marton Balint
01a19f77ca avfilter/af_channelmap: add support for unknown input channel layouts
Reviewed-by: Nicolas George <george@nsup.org>
Signed-off-by: Marton Balint <cus@passwd.hu>
2016-12-10 11:57:11 +01:00
Marton Balint
bffc2bcd75 avfilter/af_atempo: add support for unknown channel layouts
Reviewed-by: Nicolas George <george@nsup.org>
Signed-off-by: Marton Balint <cus@passwd.hu>
2016-12-10 11:57:11 +01:00
Marton Balint
7ceb9e6b11 avfilter/formats: allow unknown channel layouts by default
Since the default in the libav fork is to only allow known layouts, making
unknown layouts allowed by default here can be a security risk for filters
directly merged from libav. However, usually it is simple to detect such cases,
use of av_get_channel_layout_nb_channels is a good indicator, so I suggest we
change this regardless.

See http://ffmpeg.org/pipermail/ffmpeg-devel/2016-November/203204.html.

This patch indirectly adds unknown channel layout support for filters where
query_formats is not specified:

abench
afifo
ainterleave
anullsink
apad
aperms
arealtime
aselect
asendcmd
asetnsamples
asetpts
asettb
ashowinfo
azmq

It introduces a query_formats callback for the asyncts filter, which only
supports known channel layouts since it is using libavresample.

And it removes .query_formats callback from filters where it was only there to
support unknown layouts, as this is now the default:

aloop
ametadata
anull
asidedata
asplit
atrim

Acked-by: Nicolas George <george@nsup.org>
Signed-off-by: Marton Balint <cus@passwd.hu>
2016-12-10 11:57:11 +01:00
Michael Niedermayer
5b73ba9887 avcodec/mpeg12dec: Add FF_CODEC_CAP_SKIP_FRAME_FILL_PARAM
This decreases the amount of computations and memory needed for analysing mpeg1/2 streams

the properties update is moved from code that is skiped if skip_frame is set
to code that is not skiped so the change doesnt loose that
from being executed

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-12-10 04:58:52 +01:00
Michael Niedermayer
65e33d8e23 swresample/resample_template: Add filter values in parallel
This is faster 2871 -> 2189  cycles for int16 matrixbench -> 23456hz
Fixes a integer overflow in a artificial corner case
Fixes part of 668007-media

Found-by: Matt Wolenetz <wolenetz@google.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-12-10 02:44:21 +01:00
Michael Niedermayer
34db650784 swresample/resample_template: Reorder operations to avoid one addition
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-12-10 02:05:17 +01:00
Michael Niedermayer
b3928a1cc6 swresample/swresample: Check count before memcpy()
Fixes undefined operation
Fixes part of 668007-media

Found-by: Matt Wolenetz <wolenetz@google.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-12-10 02:05:17 +01:00
Michael Niedermayer
8258e36385 avcodec/mpeg4videodec: Fix undefined shifts in mpeg4_decode_sprite_trajectory()
Fixes: part of 670190.ogg

Found-by: Matt Wolenetz <wolenetz@google.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-12-09 17:44:54 +01:00
Michael Niedermayer
ee2a6f5df8 avformat/oggdec: Skip streams in duration correction that did not had their duration set.
Fixes: part of 670190.ogg
Fixes integer overflow

Found-by: Matt Wolenetz <wolenetz@google.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-12-09 17:43:47 +01:00
Derek Buitenhuis
4413e950b2 h264_slice: Wait for refs to be available before we use them in error concealment
This could happen when there was a frame number gap and frame threading was used.

This fixes #5458.

Debugging-by: Ronald S. Bultje <rsbultje@gmail.com>
Debugging-by: Justin Ruggles <justin.ruggles@gmail.com>
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2016-12-09 15:00:29 +00:00
James Almer
06c62ce09c fate: add a monoscopic spherical matroska test
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: James Almer <jamrial@gmail.com>
2016-12-09 11:19:38 -03:00
James Almer
77aa8005ec fate: improve fate-mov dependencies
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: James Almer <jamrial@gmail.com>
2016-12-09 11:19:29 -03:00
Michael Niedermayer
38a7834bbb avcodec/ffv1enc: Allocate smaller packet if the worst case size cannot be allocated
We are checking during encoding if there is enough space as version 4 needs that
check.

Fixes Ticket6005

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-12-09 01:59:40 +01:00
Michael Niedermayer
cff1c0edaa avcodec/ffv1enc: Fix size of first slice
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-12-09 01:59:30 +01:00
Alex Converse
51a055b206 aacdec: Rename elem_type_prev to che_prev_type.
It describes the type of the previous che element (SCE, CPE, CCE, or
LFE) and does not reflect non-che elements.
2016-12-08 13:31:50 -08:00
Alex Converse
d379592687 aacdec: Allow SBR after DRC.
Fixes https://www2.iis.fraunhofer.de/AAC/7.1auditionOutLeader_v2_rtb.mp4

Reported-by: rcombs on IRC
2016-12-08 13:31:50 -08:00
Lou Logan
ee795d9d26 doc/muxers: remove "-strict experimental" from tee muxer examples
Examples use the native FFmpeg AAC encoder but it is no longer
considered experimental and therefore not required.

Signed-off-by: Lou Logan <lou@lrcd.com>
2016-12-08 12:06:05 -09:00
Paul B Mahol
a251149833 avfilter/vf_deband: fix silly mistakes
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2016-12-08 21:29:58 +01:00