1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-11-26 19:01:44 +02:00
Commit Graph

91564 Commits

Author SHA1 Message Date
Michael Niedermayer
40c2f870ae avcodec/aacdec_template: Check for duplicate elements
Fixes: Timeout
Fixes: 9552/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_AAC_FIXED_fuzzer-6027842339995648

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-08-04 16:17:01 +02:00
Michael Niedermayer
47db5763e2 avcodec/aacpsdsp_template: Fix integer overflow in ps_stereo_interpolate_c()
Fixes: signed integer overflow: -1813244069 + -1407981383 cannot be represented in type 'int'
Fixes: 8823/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_AAC_FIXED_fuzzer-5643295618236416

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-08-04 16:17:01 +02:00
Michael Niedermayer
6b67d7f059 avformat/flvenc: Check audio packet size
Fixes: Assertion failure
Fixes: assert_flvenc.c:941_1.swf

Found-by: #CHEN HONGXU# <HCHEN017@e.ntu.edu.sg>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-08-04 16:17:01 +02:00
Aman Gupta
476fd6ba3a avcodec/mediacodecdec: fix SEGV on modern nvidia decoders
This code came originally from gstreamer, where it was added in [1]
as a work-around for the Tegra 3. (The alignment was changed in [2]
as a response to [3], from 32-bit to 16-bit).

gstreamer only used this workaround in the case where the decoder
didn't return a slice-height property, but when the code was copied
into avcodec the conditional got lost. This commit restores the guard
and prefers the slice-height from the decoder when it is available.

This fixes segfaults decoding 1920x1080 h264 and mpeg2 videos on the
NVidia SHIELD after upgrading to Android Oreo.

[1] a870e6a5c3
[2] 21ff3ae0b0
[3] https://bugzilla.gnome.org/show_bug.cgi?id=748867

Signed-off-by: Aman Gupta <aman@tmm1.net>
2018-08-03 11:06:46 -07:00
Nikolas Bowe
5aeb3b0080 lavc/svq3: Fix regression decoding some files.
Fixes some SVQ3 encoded files which fail to decode correctly after 6d6faa2a2d.
These files exhibit lots of artifacts and logs show "Media key encryption is not implemented".
However they decode without artifacts before 6d6faa2a2d.
The attatched patch allows these files to successfully decode, but also reject media key files.

Tested on the files in #6094 and http://samples.mplayerhq.hu/V-codecs/SVQ3/Vertical400kbit.sorenson3.mov

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-08-03 02:10:14 +02:00
Michael Niedermayer
51ac3f43b8 avcodec/mlp_parser: Check if synccode is within buffer
Fixes: undefined shift
Fixes: 9216/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TRUEHD_fuzzer-6281404575907840

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-08-03 02:08:16 +02:00
Michael Niedermayer
7dd836a3f9 avcodec/qtrle: Check remaining bytestream in qtrle_decode_XYbpp()
Fixes: Timeout
Fixes: 9213/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_QTRLE_fuzzer-5649753332252672

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-08-03 02:08:16 +02:00
James Almer
2de5209d91 avformat/matroskaenc: filter and reorder AV1 OBUs
Make sure to not write forbidden OBUs to CodecPrivate, and do the same with
unnecessary OBUs for packets.

Signed-off-by: James Almer <jamrial@gmail.com>
2018-08-02 12:41:55 -03:00
James Almer
ded339fb3c avformat/av1: reorder OBUs before writting them in ff_isom_write_av1c()
Make sure Sequence Header is first, and only allow one of its kind.

Signed-off-by: James Almer <jamrial@gmail.com>
2018-08-02 12:41:54 -03:00
James Almer
692e323d89 avcodec/av1_parse: return size of the parsed OBU in parse_obu_header()
Signed-off-by: James Almer <jamrial@gmail.com>
2018-08-02 12:41:54 -03:00
James Almer
1e126560c2 avformat/av1: return an error when no data is provided to ff_isom_write_av1c()
Signed-off-by: James Almer <jamrial@gmail.com>
2018-08-02 12:41:53 -03:00
James Almer
4e937b1a60 avcodec/av1_parse: check for OBU header overread
Signed-off-by: James Almer <jamrial@gmail.com>
2018-08-02 12:41:53 -03:00
James Almer
e45ed15594 avcodec/libaomdec: auto insert dump_extra bitstream filter
Some containers, like Matroska, may propagate key frames with no Sequence
Header OBU since it's provided in extradata instead.
With this change, the Sequence Header will be appended to the packet data
before calling aom_codec_decode().

Signed-off-by: James Almer <jamrial@gmail.com>
2018-08-02 12:41:05 -03:00
James Almer
b98bd60bfa avcodec/dump_extradata_bsf: don't allocate a new AVPacket per filtered packet
~4x speedup in dump_extradata()

Signed-off-by: James Almer <jamrial@gmail.com>
2018-08-02 12:41:04 -03:00
Gyan Doshi
c9118d4d64 avformat/avs: add descriptive name and url
AVS now more commonly refers to the Chinese AVS format. This demuxer
processes video files for Creature Shock game
2018-08-02 10:53:03 +05:30
James Almer
481741ece0 x86/pixelutils: don't use the AVX2 functions on CPUs known to be slow with them
Signed-off-by: James Almer <jamrial@gmail.com>
2018-07-31 22:14:53 -03:00
James Almer
d5b3077ecf x86/pixelutils: add missing preprocessor wrapper to the AVX2 functions
Should fix compilation with old yasm/nasm

Signed-off-by: James Almer <jamrial@gmail.com>
2018-07-31 22:14:42 -03:00
Carl Eugen Hoyos
1ffd63a445 tools/qt-faststart: Allow free atoms after moov atom. 2018-08-01 00:49:54 +02:00
Jun Zhao
d36b8394f4 avutil/pixelutils: sad_32x32 sse2/avx2 optimizations.
add ff_pixelutils_sad_32x32_sse2, ff_pixelutils_sad_{a,u}_32x32_sse2,
ff_pixelutils_sad_32x32_avx22, ff_pixelutils_sad_{a,u}_32x32_avx2

use perf record/report profiling, get instructions:u for avx2 sad_32x32:

  72.05%  pixelutils  pixelutils     [.] block_sad_32x32_c
  18.50%  pixelutils  pixelutils     [.] block_sad_16x16_c
   4.78%  pixelutils  pixelutils     [.] block_sad_8x8_c
   2.69%  pixelutils  pixelutils     [.] block_sad_4x4_c
   0.89%  pixelutils  pixelutils     [.] block_sad_2x2_c
   0.16%  pixelutils  pixelutils     [.] ff_pixelutils_sad_32x32_avx2
   0.16%  pixelutils  pixelutils     [.] ff_pixelutils_sad_u_32x32_avx2
   0.12%  pixelutils  pixelutils     [.] ff_pixelutils_sad_a_32x32_avx2

sse2 sad_32x32 instructions:u like:

  71.86%  pixelutils  pixelutils     [.] block_sad_32x32_c
  18.42%  pixelutils  pixelutils     [.] block_sad_16x16_c
   4.81%  pixelutils  pixelutils     [.] block_sad_8x8_c
   2.68%  pixelutils  pixelutils     [.] block_sad_4x4_c
   0.88%  pixelutils  pixelutils     [.] block_sad_2x2_c
   0.29%  pixelutils  pixelutils     [.] ff_pixelutils_sad_32x32_sse2
   0.26%  pixelutils  pixelutils     [.] ff_pixelutils_sad_u_32x32_sse2
   0.23%  pixelutils  pixelutils     [.] ff_pixelutils_sad_a_32x32_sse2

Signed-off-by: Jun Zhao <mypopydev@gmail.com>
2018-07-31 19:17:51 +08:00
Jun Zhao
b8bf7408dc lavutil/pixelutils: add sad_32x32 in pixelutils API.
add sad_32x32 in pixelutils API, and update the fate.

Signed-off-by: Jun Zhao <mypopydev@gmail.com>
2018-07-31 19:09:35 +08:00
James Almer
a9a433564d avcodec/h264_mp4toannexb_bsf: use enum constants for the NAL unit type values
Signed-off-by: James Almer <jamrial@gmail.com>
2018-07-30 17:51:50 -03:00
Tobias Rapp
ec517ad9f9 fate: add tests for audio channel up-/downmixing with pan filter
Add tests for upmixing and downmixing with audio channel counts that
have a corresponding default layout and also tests where there is no
default layout.

Update the existing "stereo4" test so it actually outputs stereo like
the other stereo tests. Rename the previous "stereo4" test into
"upmix1".

Reviewed-by: Nicolas George <george@nsup.org>
Signed-off-by: Tobias Rapp <t.rapp@noa-archive.com>
2018-07-30 10:46:19 +02:00
Tobias Rapp
b82632b59f tests/audiogen: raise channel count limit to 12
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Tobias Rapp <t.rapp@noa-archive.com>
2018-07-30 10:46:10 +02:00
Antonio Morell
6f3e2913f5 libavformat/dashenc: Fix relative URI of HLS master playlist 2018-07-30 11:09:54 +05:30
Michael Niedermayer
67fb9c75ef doc/formats: Add documentation for skip_estimate_duration_from_pts
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Gyan Doshi <ffmpeg@gyani.pro>
2018-07-30 10:00:04 +05:30
James Almer
269daf5985 configure: add missing aandcttables dependency to asv1 and asv2 encoders
Signed-off-by: James Almer <jamrial@gmail.com>
2018-07-29 21:30:00 -03:00
James Almer
c38b9c2bf7 configure: add missing aandcttables dependency to mpegvideoenc
Also remove the superfluous aandcttables dependency from all the modules
that only need it because of mpegvideoenc

Fixes ticket #7333

Signed-off-by: James Almer <jamrial@gmail.com>
2018-07-29 21:29:13 -03:00
Jan Ekström
eb94ec3257 lavfi/nlmeans: fix aarch64 assembly with clang
Clang is more strict about some things.
2018-07-28 17:41:19 +03:00
James Almer
d228df6ff3 cmdutils: print a more descriptive error message in show_help_bsf() when no bsf is specified
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: James Almer <jamrial@gmail.com>
2018-07-28 11:14:45 -03:00
James Almer
3258cc6507 avcodec/bitstream_filters: check the input argument of av_bsf_get_by_name() for NULL
Fixes crashes like "ffmpeg -h bsf" caused by passing NULL to strcmp()

Signed-off-by: James Almer <jamrial@gmail.com>
2018-07-28 11:14:19 -03:00
Michael Niedermayer
bed125b710 avcodec/diracdec: Check bytes count in else branch in decode_lowdelay() too
Fixes: signed integer overflow: 8 * 340018243 cannot be represented in type 'int'
Fixes: 9441/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_DIRAC_fuzzer-5194665207791616

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-07-28 14:35:51 +02:00
Michael Niedermayer
f457c0ad7f avcodec/diracdec: Check slice numbers for overflows in relation to picture dimensions
Fixes: signed integer overflow: 88 * 33685506 cannot be represented in type 'int'
Fixes: 9433/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_DIRAC_fuzzer-5725943535501312

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-07-28 14:35:50 +02:00
Michael Niedermayer
462d1be6de avcodec/diracdec: Change frame_number to 64bit as its a 32bit from the bitstream and we also have a -1 special case
Fixes: signed integer overflow: 2147483647 + 1 cannot be represented in type 'int'
Fixes: 9291/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_DIRAC_fuzzer-6324345860259840

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-07-28 14:35:50 +02:00
Michael Niedermayer
69cac9e130 avcodec/dirac_dwt_template: Fix several integer overflows in horizontal_compose_daub97i()
Fixes: signed integer overflow: 2147483647 + 1 cannot be represented in type 'int'
Fixes: 8926/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_DIRAC_fuzzer-6047609228623872

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-07-28 14:35:50 +02:00
Michael Niedermayer
5129040646 avcodec/diracdec: Prevent integer overflow in intermediate in global_mv()
Fixes: signed integer overflow: -393471 * 5460 cannot be represented in type 'int'
Fixes: 8890/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_DIRAC_fuzzer-6299775379963904

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-07-28 14:35:50 +02:00
Timo Rothenpieler
ed647ab79f avformat/librtmp: fix returning EOF from Read/Write
Ticket #7052
2018-07-28 01:04:38 +02:00
James Almer
7ca892b7e5 fate: remove unnecessary reference file for fate-encryption-info
Signed-off-by: James Almer <jamrial@gmail.com>
2018-07-27 13:06:29 -03:00
James Almer
536bcc30e0 avcodec: add missing files missed in previous commits
Fixes compilation.

Signed-off-by: James Almer <jamrial@gmail.com>
2018-07-27 11:15:59 -03:00
hwren
5985a1bf72 lavc, doc, configure: add avs2 video decoder wrapper
Tested-by: Steven Liu <lq@chinaffmpeg.org>
Signed-off-by: hwren <hwrenx@126.com>
Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
2018-07-27 20:07:56 +08:00
hwren
b7b7b8e8a1 lavf: add avs2 fourcc
Signed-off-by: hwren <hwrenx@126.com>
Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
2018-07-27 20:07:52 +08:00
hwren
d645e0d6c1 lavc: add AVS2/IEEE 1857.4 parser
Tested-by: Steven Liu <lq@chinaffmpeg.org>
Signed-off-by: hwren <hwrenx@126.com>
Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
2018-07-27 20:07:45 +08:00
Jun Zhao
a8ce6fb425 doc/protocols: documents tcp_mss
Signed-off-by: Jun Zhao <mypopydev@gmail.com>
2018-07-26 19:03:24 +08:00
Jun Zhao
790cf9518a lavf/tcp: add option to setting Maximum Segment Size
This can change the the MSS value announced to the other end in
the initial TCP packet, it's can be used when failed Path MTU
discovery.

Signed-off-by: Jun Zhao <mypopydev@gmail.com>
2018-07-26 19:03:24 +08:00
Michael Niedermayer
bce4da85e8 swresample/swresample: Fix input channel count in resample_first computation
Found-by: Marcin Gorzel <gorzel@google.com>
Reviewed-by: Marcin Gorzel <gorzel@google.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-07-26 02:42:42 +02:00
Michael Niedermayer
a37c620269 avformat/mov: Check default_encrypted_sample before use in mov_read_sample_encryption_info()
Fixes: 2018-0721-sample
Fixes: null pointer dereference

Found-by: Nikita Knyzhov (knnikita@yandex.ru)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-07-26 02:42:42 +02:00
Marcin Gorzel
8b710ea5e7 swresample: Use channel count in rematrix initialization
Rematrixing supports up to 64 channels. However, there is only a limited number of channel layouts defined. Since the in/out channel count is currently obtained from the channel layout, for undefined layouts (e.g. for 9, 10, 11 channels etc.) the rematrixing fails.

This patch changes rematrix init methods to use in (used) and out channel count directly instead of computing it from channel layout.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-07-26 02:42:42 +02:00
Carl Eugen Hoyos
d01d46ad86 configure: Force pie for Android.
Position-independent executables are required since Lollipop.

Reported-by: Mohammed Bey Ahmed Khernache
2018-07-25 20:43:02 +02:00
James Almer
81a18f219e avutil/hwcontext_d3d11va: fix type arguments passed to IDXGIAdapter2_GetDesc()
libavutil/hwcontext_d3d11va.c: In function 'd3d11va_device_create':
libavutil/hwcontext_d3d11va.c:554:46: warning: passing argument 2 of 'pAdapter->lpVtbl->GetDesc' from incompatible pointer type [-Wincompatible-pointer-types]
         hr = IDXGIAdapter2_GetDesc(pAdapter, &desc);
                                              ^
libavutil/hwcontext_d3d11va.c:554:46: note: expected 'DXGI_ADAPTER_DESC * {aka struct DXGI_ADAPTER_DESC *}' but argument is of type 'DXGI_ADAPTER_DESC2 * {aka struct DXGI_ADAPTER_DESC2 *}'

Reviewed-by: Jean-Baptiste Kempf <jb@videolan.org>
Signed-off-by: James Almer <jamrial@gmail.com>
2018-07-25 15:22:30 -03:00
Carl Eugen Hoyos
fa35ab80f3 lavf/isom: Make auxiliary_offsets consistently uint64_t.
Fixes a compilation warning if size_t != uint64_t:
libavformat/mov.c: In function ‘mov_read_saio’:
libavformat/mov.c:6207:45: warning: assignment from incompatible pointer type [-Wincompatible-pointer-types]
         encryption_index->auxiliary_offsets = auxiliary_offsets;
                                             ^
2018-07-25 20:06:04 +02:00
Carl Eugen Hoyos
c51e0cd6ed lavf/flvdec: Remove an outdated comment.
The buffer size was increased in b2fecce3 to prepare for 790a3cdf.
2018-07-25 15:08:43 +02:00