ffmpeg.git
23 months agoAdd support for LibOpenJPEG v2.2/git
Reino17 [Fri, 23 Jun 2017 21:49:31 +0000 (23:49 +0200)]
Add support for LibOpenJPEG v2.2/git

Signed-off-by: Michael Bradshaw <mjbshaw@google.com>
23 months agocheckasm: add missing checks to float_dsp's butterflies_float test
James Almer [Sat, 24 Jun 2017 02:38:07 +0000 (23:38 -0300)]
checkasm: add missing checks to float_dsp's butterflies_float test

23 months agomdct15: add assembly optimizations for the 15-point FFT
Rostislav Pehlivanov [Sun, 18 Jun 2017 11:06:30 +0000 (12:06 +0100)]
mdct15: add assembly optimizations for the 15-point FFT

c:    1802 decicycles in fft15,16774635 runs,   2581 skips
avx:   865 decicycles in fft15,16776378 runs,    838 skips

Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
23 months agoconfigure: fix assignment of assembler specific flags
James Almer [Fri, 23 Jun 2017 14:32:52 +0000 (11:32 -0300)]
configure: fix assignment of assembler specific flags

If the first assembler to be probed is an old nasm build, X86ASM_DEPFLAGS
will be set and remain so after yasm is ultimately used as fallback.
This results in yasm being called with said nasm specific flags and failing
during actual object assembly but not with configure sanity checks.

Regression since 5cae5a1defa360da076365a786093a749d1ddf4e

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: James Almer <jamrial@gmail.com>
23 months agoRevert "lavfi/buffersrc: push the frame deeper if requested."
Paul B Mahol [Fri, 23 Jun 2017 14:18:42 +0000 (16:18 +0200)]
Revert "lavfi/buffersrc: push the frame deeper if requested."

Fixes framesync filters with shortest option enabled.

This reverts commit 0ff5567a30be6d7c804e95997ae282d6bacd76c3.

23 months agolavc/videotoolboxenc: fix open videotoolbox bug on iOS8.4
jerett [Fri, 23 Jun 2017 12:58:35 +0000 (08:58 -0400)]
lavc/videotoolboxenc: fix open videotoolbox bug on iOS8.4

Checks for NULL before using object.

Signed-off-by: Rick Kern <kernrj@gmail.com>
23 months agolavc/videotoolboxenc: fix loadVTEncSymbols crash when symbol not found
jerett [Fri, 23 Jun 2017 12:57:18 +0000 (08:57 -0400)]
lavc/videotoolboxenc: fix loadVTEncSymbols crash when symbol not found

Signed-off-by: Rick Kern <kernrj@gmail.com>
23 months agolavc/golomb: add value range comment for set_ue_golomb().
Jun Zhao [Wed, 14 Jun 2017 02:08:58 +0000 (10:08 +0800)]
lavc/golomb: add value range comment for set_ue_golomb().

set_ue_golomb just support 2^16 - 2 at most, becase this function call
put_bits, and put_bits just support write up to 31 bits, when write 32
bit in put_bits, it's will overwrite the bit buffer, and the default
assert level is 0, the av_assert2(n <= 31 && value < (1U << n)) in
put_bits can not be trigger runtime.

Signed-off-by: Jun Zhao <jun.zhao@intel.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
23 months agoavcodec/wavpack: Fix integer overflow
Michael Niedermayer [Thu, 22 Jun 2017 23:58:48 +0000 (01:58 +0200)]
avcodec/wavpack: Fix integer overflow

Fixes: runtime error: signed integer overflow: 227511904 + 1964113935 cannot be represented in type 'int'
Fixes: 2331/clusterfuzz-testcase-minimized-6182185830711296

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
23 months agoavcodec/takdec: Fix integer overflow
Michael Niedermayer [Thu, 22 Jun 2017 19:21:56 +0000 (21:21 +0200)]
avcodec/takdec: Fix integer overflow

Fixes: runtime error: signed integer overflow: 512 + 2147483146 cannot be represented in type 'int'
Fixes: 2314/clusterfuzz-testcase-minimized-4519333877252096

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
23 months agoavcodec/tiff: Update pointer only when the result is used
Michael Niedermayer [Thu, 22 Jun 2017 18:21:05 +0000 (20:21 +0200)]
avcodec/tiff: Update pointer only when the result is used

Fixes: runtime error: signed integer overflow: 538976288 * 32 cannot be represented in type 'int'
Fixes: 2310/clusterfuzz-testcase-minimized-4534784887881728

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
23 months agoopus_celt: do not use double precision exp2
Rostislav Pehlivanov [Thu, 22 Jun 2017 21:37:53 +0000 (22:37 +0100)]
opus_celt: do not use double precision exp2

Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
23 months agoavformat/oggenc: check for stream private data in ogg_free()
James Almer [Thu, 22 Jun 2017 18:51:28 +0000 (15:51 -0300)]
avformat/oggenc: check for stream private data in ogg_free()

Fixes a NULL pointer derefence when ogg_init() returns a failure and
a stream's private data was not yet allocated.

This is a regression since 3c5a53cdfa099bba8bd951f95b85727b4b3b5d68

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
23 months agocheckasm/aarch64: fix tests returning a float
Matthieu Bouron [Mon, 19 Jun 2017 08:55:28 +0000 (10:55 +0200)]
checkasm/aarch64: fix tests returning a float

Avoids overriding the v0 register (which containins the result of the
tested function) in checkasm_call_checked.

23 months agoavcodec/cfhd: Check bpc before setting bpc in context
Michael Niedermayer [Wed, 21 Jun 2017 17:34:31 +0000 (19:34 +0200)]
avcodec/cfhd: Check bpc before setting bpc in context

Fixes: runtime error: shift exponent 32 is too large for 32-bit type 'int'
Fixes: 2306/clusterfuzz-testcase-minimized-5002997392211968

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
23 months agoavcodec/cfhd: Fix undefined shift
Michael Niedermayer [Wed, 21 Jun 2017 15:56:34 +0000 (17:56 +0200)]
avcodec/cfhd: Fix undefined shift

Fixes: runtime error: left shift of negative value -1
Fixes: 2303/clusterfuzz-testcase-minimized-5529675273076736

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
23 months agoconfigure: Move x86 assembler sanity check into assembler probe function
Diego Biurrun [Mon, 22 May 2017 12:48:15 +0000 (12:48 +0000)]
configure: Move x86 assembler sanity check into assembler probe function

This allows for more graceful fallback from NASM to Yasm if the available
NASM version is too old.

(Cherry-picked from libav commit adfd7892e3b8b40e7a1620f7254459d8e096a9a1)
Signed-off-by: James Almer <jamrial@gmail.com>
23 months agobuild: Prefer NASM assembler over YASM
Diego Biurrun [Thu, 13 Oct 2016 18:33:15 +0000 (18:33 +0000)]
build: Prefer NASM assembler over YASM

NASM is more actively maintained and permits generating dependency information
as a sideeffect of assembling, thus cutting build times in half.

(Cherry-picked from libav commit 57b753b445e23363c997a8ec1c556e0b0f6e9da3)

Signed-off-by: James Almer <jamrial@gmail.com>
23 months agobuild: fix commandline selection of nasm
James Almer [Tue, 20 Jun 2017 22:14:32 +0000 (19:14 -0300)]
build: fix commandline selection of nasm

"nasm --version" works on nasm since around version 2.11 and as
such configure assumed it was yasm.

Based on libav commit f54037da8af2f2aeb5e5633b48434211e6a97fe5 by
Diego Biurrun.

Signed-off-by: James Almer <jamrial@gmail.com>
23 months agobuild: Explicitly set 32-bit/64-bit object formats for nasm/yasm
Diego Biurrun [Wed, 1 Mar 2017 18:42:21 +0000 (18:42 +0000)]
build: Explicitly set 32-bit/64-bit object formats for nasm/yasm

Consistently use object format names with "32" suffix and set object format
to "win64" on Windows x86_64, which fixes assembling with nasm.

(Cherry-picked from libav commit 808ef43597b1e3d6e69a5b9abe2237c8ddb97b44)

Signed-off-by: James Almer <jamrial@gmail.com>
23 months agobuild: Allow generating dependencies as a side-effect of assembling
Diego Biurrun [Thu, 13 Oct 2016 00:45:09 +0000 (00:45 +0000)]
build: Allow generating dependencies as a side-effect of assembling

(Cherry-picked from libav commit 3c0efbd03349ae68d3a25a082222652a102e3fd4)

Signed-off-by: James Almer <jamrial@gmail.com>
23 months agobuild: Generalize yasm/nasm-related variable names
Diego Biurrun [Sat, 8 Oct 2016 14:18:33 +0000 (14:18 +0000)]
build: Generalize yasm/nasm-related variable names

None of them are specific to the YASM assembler.

(Cherry-picked from libav commit 39e208f4d4756367c7cd2d581847e0c1b8a429c1)

Signed-off-by: James Almer <jamrial@gmail.com>
23 months agoavfilter/af_stereotools: add forgotten break
Paul B Mahol [Wed, 21 Jun 2017 17:20:25 +0000 (19:20 +0200)]
avfilter/af_stereotools: add forgotten break

Signed-off-by: Paul B Mahol <onemda@gmail.com>
23 months agomdec: stop preferring the simple IDCT.
Ronald S. Bultje [Wed, 21 Jun 2017 13:01:20 +0000 (09:01 -0400)]
mdec: stop preferring the simple IDCT.

This was added in e3e3c82555e2382125195c1ba9f34b5a43299abc, probably
as a workaround for the fact that the quant table was not permutated
and the IDCT coefficients are, meaning that you'd only get correct
reconstruction if the IDCT permutation was an identity matrix, which
happens to be the case when you use the simple IDCT. The quant table
permutation bug was fixed in 42dd1434bf6a7230e4175c08fcfabc3ba51a0463,
meaning this workaround is no longer necessary.

In practical terms, before 42dd1434bf6a7230e4175c08fcfabc3ba51a0463,
the PSNR between decodes of the fate-mdec using simple (C) or simplemmx
IDCTs was 35. After 42dd1434bf6a7230e4175c08fcfabc3ba51a0463, it's 90.

23 months agomdec: use correctly permutated quant matrix for dequantization.
Ronald S. Bultje [Wed, 21 Jun 2017 12:53:43 +0000 (08:53 -0400)]
mdec: use correctly permutated quant matrix for dequantization.

23 months agoaarch64: vp9 16bpp: Fix assembling with Xcode 6.2 and older
Memphiz [Sun, 18 Jun 2017 10:29:38 +0000 (12:29 +0200)]
aarch64: vp9 16bpp: Fix assembling with Xcode 6.2 and older

Properly use the b.eq form instead of the nonstandard form (which
both gas and newer clang accept though), and expand the register
lists that used a range (which the Xcode 6.2 clang, based on clang
3.5 svn, didn't support).

Signed-off-by: Martin Storsjö <martin@martin.st>
23 months agoaarch64: vp9: Fix assembling with Xcode 6.2 and older
Memphiz [Sun, 18 Jun 2017 10:30:16 +0000 (12:30 +0200)]
aarch64: vp9: Fix assembling with Xcode 6.2 and older

Properly use the b.eq/b.ge forms instead of the nonstandard forms
(which both gas and newer clang accept though), and expand the
register list that used a range (which the Xcode 6.2 clang, based
on clang 3.5 svn, didn't support).

This is cherrypicked from libav commit
a970f9de865c84ed5360dd0398baee7d48d04620.

Signed-off-by: Martin Storsjö <martin@martin.st>
23 months agoavcodec/mpegvideo: Use intra_scantable in dct_unquantize_h263_intra_c()
Michael Niedermayer [Mon, 19 Jun 2017 22:37:40 +0000 (00:37 +0200)]
avcodec/mpegvideo: Use intra_scantable in dct_unquantize_h263_intra_c()

Reviewed-by: James Darnley <jdarnley@obe.tv>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
23 months agoavcodec/hevc_filter: Fix invalid shift
Michael Niedermayer [Tue, 20 Jun 2017 12:38:34 +0000 (14:38 +0200)]
avcodec/hevc_filter: Fix invalid shift

Fixes: runtime error: left shift of negative value -1

Fixes: 2299/clusterfuzz-testcase-minimized-4843509351710720

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
23 months agoavcodec/hevcdec: Check beta and tc offset in hls_slice_header()
Michael Niedermayer [Tue, 20 Jun 2017 12:32:50 +0000 (14:32 +0200)]
avcodec/hevcdec: Check beta and tc offset in hls_slice_header()

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
23 months agoavcodec/mpeg4videodec: Fix overflow in virtual_ref computation
Michael Niedermayer [Tue, 20 Jun 2017 11:52:06 +0000 (13:52 +0200)]
avcodec/mpeg4videodec: Fix overflow in virtual_ref computation

Fixes: runtime error: signed integer overflow: 262144 * -16120 cannot be represented in type 'int'
Fixes: 2292/clusterfuzz-testcase-minimized-6156080415506432

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
23 months agoavcodec/lpc: signed integer overflow in compute_lpc_coefs() (aacdec_fixed)
Michael Niedermayer [Wed, 14 Jun 2017 23:35:49 +0000 (01:35 +0200)]
avcodec/lpc: signed integer overflow in compute_lpc_coefs() (aacdec_fixed)

Fixes: runtime error: signed integer overflow: -1575818955 + -915383657 cannot be represented in type 'int'
Fixes: 2224/clusterfuzz-testcase-minimized-6208559949807616

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
23 months agoconfigure: Move up the avbuild directory creation
Luca Barbato [Fri, 10 Feb 2017 19:31:34 +0000 (19:31 +0000)]
configure: Move up the avbuild directory creation

The early check for inconsistent in-source vs out-of-source build
cannot generate a config.log otherwise.

(Cherry-picked from libav commit 0ee78020cd41d81eec651acd7fc65906207796f3)
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
Signed-off-by: James Almer <jamrial@gmail.com>
23 months agoavcodec/decode: Update decode_simple_internal() to get the side data correctly.
John Rummell [Wed, 14 Jun 2017 21:43:04 +0000 (14:43 -0700)]
avcodec/decode: Update decode_simple_internal() to get the side data correctly.

Use avci->last_pkt_props to get the side data. Using |pkt| doesn't work
when FF_API_MERGE_SD is set, as the compressed side data is expanded into
|tmp|, leaving the original |pkt| unchanged.

Signed-off-by: James Almer <jamrial@gmail.com>
23 months agoavcodec/x86: allow future 8-bit simple idct to use slightly different coefficients
James Darnley [Mon, 12 Jun 2017 11:32:57 +0000 (12:32 +0100)]
avcodec/x86: allow future 8-bit simple idct to use slightly different coefficients

23 months agoavcodec/mdec: override IDCT choice before initing DSP structs
James Darnley [Sat, 17 Jun 2017 01:13:36 +0000 (03:13 +0200)]
avcodec/mdec: override IDCT choice before initing DSP structs

23 months agoavcodec/x86: modify simple_idct10 macros to add an action paramter
James Darnley [Mon, 12 Jun 2017 10:01:21 +0000 (12:01 +0200)]
avcodec/x86: modify simple_idct10 macros to add an action paramter

23 months agoavcodec/x86: cleanup simple_idct10
James Darnley [Thu, 1 Jun 2017 13:28:29 +0000 (15:28 +0200)]
avcodec/x86: cleanup simple_idct10

Use named arguments for the functions so we can remove a define.  The
stride/linesize argument is now ptrdiff_t type so we no longer need to
sign extend the register.

23 months agoavcodec/x86/mpegenc: support transpose permuation type
James Darnley [Fri, 16 Jun 2017 13:36:16 +0000 (15:36 +0200)]
avcodec/x86/mpegenc: support transpose permuation type

23 months agoavcodec/x86/mpegenc: check IDCT permutation type is a valid value
James Darnley [Fri, 16 Jun 2017 12:53:15 +0000 (14:53 +0200)]
avcodec/x86/mpegenc: check IDCT permutation type is a valid value

23 months agobuild: Add missing idctdsp dependency for clearvideo
Diego Biurrun [Wed, 7 Jun 2017 10:48:00 +0000 (12:48 +0200)]
build: Add missing idctdsp dependency for clearvideo

(cherry picked from commit 2f792cb6703b5b12f2e873bee13f33da8aa9940a)

23 months agoffmpeg: remove misleading and incorrect warning messages
wm4 [Thu, 15 Jun 2017 16:52:14 +0000 (18:52 +0200)]
ffmpeg: remove misleading and incorrect warning messages

It is wrong/incorrect in two aspects:
1. The pixel format is not enough to guarantee that the resulting file
   will be any more compatible with media players.
2. Media players not supporting higher profiles are not necessarily
   outdated (in fact this is simply an arrogant statement that
   libavcodec can handle these particular features).

You could add that there are plenty of other ways to produce widely
incompatible files with ffmpeg, and these don't show any warnings.

What we really want to do here is defaulting to codec profiles that
have wide compatibility, such as main/high for h264. Also, if an
encoder does not accept certain pixfmts, we should automatically
convert them to a pixfmt the encoder can accept. But the existing
message certainly is not appropriate.

It also works for 2 specific encoders only. Extending it for other
cases would result in a lot of special cases, so this is not the
right place.

23 months agoavcodec/x86/mpegvideo: Use intra scantable in dct_unquantize_h263_intra_mmx()
Michael Niedermayer [Mon, 19 Jun 2017 21:47:13 +0000 (23:47 +0200)]
avcodec/x86/mpegvideo: Use intra scantable in dct_unquantize_h263_intra_mmx()

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
23 months agoavcodec/h264: Fix mix of lossless and lossy MBs decoding
Anton Mitrofanov [Wed, 14 Jun 2017 00:01:56 +0000 (03:01 +0300)]
avcodec/h264: Fix mix of lossless and lossy MBs decoding

Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
23 months agoavcodec/h264_mb: Fix 8x8dct in lossless for new versions of x264
Anton Mitrofanov [Tue, 13 Jun 2017 20:37:29 +0000 (23:37 +0300)]
avcodec/h264_mb: Fix 8x8dct in lossless for new versions of x264

Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
23 months agoavcodec/h264_cabac: Fix CABAC+8x8dct in 4:4:4
Anton Mitrofanov [Tue, 30 May 2017 23:37:41 +0000 (02:37 +0300)]
avcodec/h264_cabac: Fix CABAC+8x8dct in 4:4:4

Use the correct ctxIdxInc calculation for coded_block_flag.
Keep old behavior for old versions of x264 for backward compatibility.

Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
23 months agolibavfilter/scale: Populate ow/oh when using 0 as w/h
Kevin Mark [Wed, 14 Jun 2017 05:03:18 +0000 (01:03 -0400)]
libavfilter/scale: Populate ow/oh when using 0 as w/h

The input width and height is known at parse time so there's no
reason ow/oh should not be usable when using 0 as the width or
height expression.

Previously in "scale=0:ow" ow would be set to "0" which works,
conveniently, as "scale=0:0" is perfectly valid input but this breaks
down when you do something like "scale=0:ow/4" which one could
reasonably expect to work as well, but does not as ow is 0 not the
real value.

This change handles the 0 case for w/h immediately so the ow/oh
variables work as expected. Consequently, the rest of the code does
not need to handle 0 input. w/h will always be > 0 or < 0.

The second explicit (int) cast ensures that ow/oh appear as integers
as a user might expect when dealing with pixel dimensions.

Signed-off-by: Kevin Mark <kmark937@gmail.com>
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
23 months agodoc/filters: Correct scale doc regarding w/h <= 0
Kevin Mark [Mon, 12 Jun 2017 05:59:05 +0000 (01:59 -0400)]
doc/filters: Correct scale doc regarding w/h <= 0

According to libavfilter/scale.c, if the width and height are both
less than or equal to 0 then the input size is used for both
dimensions. It does not need to be -1. -1:-1 is the same as 0:0 which
is the same as -10:-42, etc.

if (w < 0 && h < 0)
    eval_w = eval_h = 0;

The documentation for the zscale filter has also been updated since the
behavior is identical.

Signed-off-by: Kevin Mark <kmark937@gmail.com>
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
23 months agodoc/filters: fix typo
Paul B Mahol [Mon, 19 Jun 2017 17:28:43 +0000 (19:28 +0200)]
doc/filters: fix typo

Signed-off-by: Paul B Mahol <onemda@gmail.com>
23 months agoavfilter/af_stereotools: add 2 more modes
Paul B Mahol [Mon, 19 Jun 2017 16:59:33 +0000 (18:59 +0200)]
avfilter/af_stereotools: add 2 more modes

Signed-off-by: Paul B Mahol <onemda@gmail.com>
23 months agoavfilter/af_superequalizer: stop leaking s->out frame
Paul B Mahol [Mon, 19 Jun 2017 16:34:04 +0000 (18:34 +0200)]
avfilter/af_superequalizer: stop leaking s->out frame

Signed-off-by: Paul B Mahol <onemda@gmail.com>
23 months agoavfilter/af_superequalizer: improve description
Paul B Mahol [Mon, 19 Jun 2017 16:15:51 +0000 (18:15 +0200)]
avfilter/af_superequalizer: improve description

Signed-off-by: Paul B Mahol <onemda@gmail.com>
23 months agoavfilter/af_superequalizer: fix out of array access
Paul B Mahol [Mon, 19 Jun 2017 16:12:29 +0000 (18:12 +0200)]
avfilter/af_superequalizer: fix out of array access

Signed-off-by: Paul B Mahol <onemda@gmail.com>
23 months agoavcodec/wavpack: Fix undefined integer negation
Michael Niedermayer [Mon, 19 Jun 2017 12:08:58 +0000 (14:08 +0200)]
avcodec/wavpack: Fix undefined integer negation

Fixes: runtime error: negation of -2147483648 cannot be represented in type 'int'; cast to an unsigned type to negate this value to itself
Fixes: 2291/clusterfuzz-testcase-minimized-5538453481586688

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
23 months agoavcodec/aacdec_fixed: Check s for being too small
Michael Niedermayer [Mon, 19 Jun 2017 12:04:32 +0000 (14:04 +0200)]
avcodec/aacdec_fixed: Check s for being too small

Fixes: runtime error: shift exponent -8 is negative
Fixes: 2286/clusterfuzz-testcase-minimized-5711764169687040

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
23 months agoavcodec: Rename ff_mpv_decode_mb() to ff_mpv_reconstruct_mb
Michael Niedermayer [Sun, 18 Jun 2017 18:15:05 +0000 (20:15 +0200)]
avcodec: Rename ff_mpv_decode_mb() to ff_mpv_reconstruct_mb

The new name more accuratly describes what the function does

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
23 months agoavfilter: add roberts cross operator
Paul B Mahol [Mon, 19 Jun 2017 10:54:29 +0000 (12:54 +0200)]
avfilter: add roberts cross operator

Signed-off-by: Paul B Mahol <onemda@gmail.com>
23 months agoavfilter: add superequalizer filter
Paul B Mahol [Fri, 16 Jun 2017 12:07:01 +0000 (14:07 +0200)]
avfilter: add superequalizer filter

Signed-off-by: Paul B Mahol <onemda@gmail.com>
23 months agolavfi: print the error message when threading init fails.
Nicolas George [Mon, 19 Jun 2017 08:28:41 +0000 (10:28 +0200)]
lavfi: print the error message when threading init fails.

23 months agoavformat/hlsenc: donnot show duplicate segment warning at byterange mode
Steven Liu [Mon, 19 Jun 2017 02:35:41 +0000 (10:35 +0800)]
avformat/hlsenc: donnot show duplicate segment warning at byterange mode

When the hlsenc at BYTERANGE mode, it should not show the warning message:
"Duplicated segment filename detected:"

Reported-by: Marco <marco@worldcast.com>
Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
23 months agox86/aacpsdsp: add ff_ps_hybrid_analysis_ileave_sse
James Almer [Mon, 12 Jun 2017 22:27:29 +0000 (19:27 -0300)]
x86/aacpsdsp: add ff_ps_hybrid_analysis_ileave_sse

About 2x faster than the c version.

23 months agox86/aacpsdsp: add ff_ps_hybrid_synthesis_deint_{sse,sse4}
James Almer [Mon, 19 Jun 2017 01:33:27 +0000 (22:33 -0300)]
x86/aacpsdsp: add ff_ps_hybrid_synthesis_deint_{sse,sse4}

About 2x faster than the c version.

23 months agoavformat/oggenc: add ogg_init() and ogg_free()
James Almer [Sun, 28 May 2017 20:07:06 +0000 (17:07 -0300)]
avformat/oggenc: add ogg_init() and ogg_free()

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: James Almer <jamrial@gmail.com>
23 months agofate: use do_md5sum instead of the md5 protocol for most md5 fate tests
Marton Balint [Fri, 16 Jun 2017 20:08:02 +0000 (22:08 +0200)]
fate: use do_md5sum instead of the md5 protocol for most md5 fate tests

The md5 protocol has no seek support, but some tests use seeks. This changes
the fate tests to actually create the output files and calculate the md5 on the
written files, which also makes the tests independent of the size of the output
buffers and output buffering in general.

A new md5pipe fate test method is also introduced to keep the old functionality
for tests where using a non-seekable output was intentional, and matroska md5
tests are changed to use that.

Signed-off-by: Marton Balint <cus@passwd.hu>
23 months agoavfilter/af_amix: fix possible hang
Paul B Mahol [Sun, 18 Jun 2017 16:38:36 +0000 (18:38 +0200)]
avfilter/af_amix: fix possible hang

Fixes #6424.

Signed-off-by: Paul B Mahol <onemda@gmail.com>
23 months agoavconv_hw: Free device on initialisation failure
Mark Thompson [Fri, 16 Jun 2017 22:18:55 +0000 (23:18 +0100)]
avconv_hw: Free device on initialisation failure

Fixes CID 1412852.

(cherry picked from commit c2b0bea40f1fd4399ff6184a2df4f397c0f4b3ab)

23 months agovf_hwmap: Properly free a locally derived device
Mark Thompson [Fri, 16 Jun 2017 22:11:51 +0000 (23:11 +0100)]
vf_hwmap: Properly free a locally derived device

Fixes CID 1412853.

(cherry picked from commit a670eea56087d0ecd4fbeccf3a9beb9110b7031f)

23 months agovf_hwmap: Add missing error code
Mark Thompson [Fri, 16 Jun 2017 22:08:47 +0000 (23:08 +0100)]
vf_hwmap: Add missing error code

Fixes CID 1412854.

(cherry picked from commit 5635c80bf59d90e63ede473e2c014647850a8446)

23 months agolibavfilter/af_biquads: add shorter option for width_type
Paul B Mahol [Sun, 18 Jun 2017 15:31:03 +0000 (17:31 +0200)]
libavfilter/af_biquads: add shorter option for width_type

Signed-off-by: Paul B Mahol <onemda@gmail.com>
23 months agoavformat/rmenc: do not access AVIO write buffer directly
Marton Balint [Fri, 16 Jun 2017 20:45:23 +0000 (22:45 +0200)]
avformat/rmenc: do not access AVIO write buffer directly

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Marton Balint <cus@passwd.hu>
23 months agoCleanly exit at the end of an Interplay MVE
Hein-Pieter van Braam [Sat, 17 Jun 2017 19:43:36 +0000 (21:43 +0200)]
Cleanly exit at the end of an Interplay MVE

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Hein-Pieter van Braam <hp@tmm.cx>
Signed-off-by: James Almer <jamrial@gmail.com>
23 months agoavcodec/htmlsubtitles: Factor open brace handling into its own function
Michael Niedermayer [Mon, 12 Jun 2017 22:01:04 +0000 (00:01 +0200)]
avcodec/htmlsubtitles: Factor open brace handling into its own function

Suggested-by: wm4
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
23 months agoavcodec/htmlsubtitles: Replace very slow redundant sscanf() calls by cleaner and...
Michael Niedermayer [Sun, 11 Jun 2017 15:58:45 +0000 (17:58 +0200)]
avcodec/htmlsubtitles: Replace very slow redundant sscanf() calls by cleaner and faster code

This reduces the worst case from O(n²) to O(n) time

Fixes Timeout
Fixes: 2127/clusterfuzz-testcase-minimized-6595787859427328

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
23 months agoavcodec/takdec: Fixes: integer overflow in AV_SAMPLE_FMT_U8P output
Michael Niedermayer [Sun, 18 Jun 2017 12:37:19 +0000 (14:37 +0200)]
avcodec/takdec: Fixes: integer overflow in AV_SAMPLE_FMT_U8P output

Fixes: runtime error: signed integer overflow: 2147483543 + 128 cannot be represented in type 'int'
Fixes: 2234/clusterfuzz-testcase-minimized-6266896041115648

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
23 months agoavcodec/iff: Cleanup on init failure
Michael Niedermayer [Sun, 18 Jun 2017 12:05:12 +0000 (14:05 +0200)]
avcodec/iff: Cleanup on init failure

Fixes: memleak
Fixes: 2272/clusterfuzz-testcase-minimized-5059103858622464

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
23 months agolibavformat/file: return AVERROR_EOF on EOF
Daniel Kucera [Mon, 5 Jun 2017 18:30:16 +0000 (20:30 +0200)]
libavformat/file: return AVERROR_EOF on EOF

Signed-off-by: Daniel Kucera <daniel.kucera@gmail.com>
Reviewed-by: Nicolas George <george@nsup.org>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
23 months agolibavformat/subfile: return AVERROR_EOF on EOF
Daniel Kucera [Mon, 5 Jun 2017 18:32:39 +0000 (20:32 +0200)]
libavformat/subfile: return AVERROR_EOF on EOF

Signed-off-by: Daniel Kucera <daniel.kucera@gmail.com>
Reviewed-by: Nicolas George <george@nsup.org>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
23 months agoavcodec/jpeg2000dsp: Reorder operations in ict_int() to avoid 2 integer overflows
Michael Niedermayer [Sat, 17 Jun 2017 13:06:21 +0000 (15:06 +0200)]
avcodec/jpeg2000dsp: Reorder operations in ict_int() to avoid 2 integer overflows

Fixes: runtime error: signed integer overflow: 58065 * 51981 cannot be represented in type 'int'
Fixes: 2271/clusterfuzz-testcase-minimized-5778297776504832

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
23 months agoavcodec/hevcpred_template: Fix left shift of negative value
Michael Niedermayer [Sat, 17 Jun 2017 12:54:19 +0000 (14:54 +0200)]
avcodec/hevcpred_template: Fix left shift of negative value

Fixes: runtime error: left shift of negative value -1
Fixes: 2250/clusterfuzz-testcase-minimized-5693382112313344

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
23 months agoavformat/libssh: check the user provided a password before trying to use it
James Almer [Sun, 11 Jun 2017 17:17:30 +0000 (14:17 -0300)]
avformat/libssh: check the user provided a password before trying to use it

Fixes ticket #6413

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: James Almer <jamrial@gmail.com>
23 months agoavcodec/hevcdec: Fix signed integer overflow in decode_lt_rps()
Michael Niedermayer [Fri, 16 Jun 2017 22:34:08 +0000 (00:34 +0200)]
avcodec/hevcdec: Fix signed integer overflow in decode_lt_rps()

Fixes: runtime error: signed integer overflow: 2147483647 + 6 cannot be represented in type 'int'
Fixes: 2263/clusterfuzz-testcase-minimized-4800359627227136

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
23 months agoavcodec/gdv: Fix undefined shift
Michael Niedermayer [Fri, 16 Jun 2017 21:31:42 +0000 (23:31 +0200)]
avcodec/gdv: Fix undefined shift

Fixes: runtime error: left shift of 255 by 24 places cannot be represented in type 'int'
Fixes: 2249/clusterfuzz-testcase-minimized-5388542379294720

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
23 months agoavcodec/jpeg2000dec: Check nonzerobits more completely
Michael Niedermayer [Fri, 16 Jun 2017 17:57:08 +0000 (19:57 +0200)]
avcodec/jpeg2000dec: Check nonzerobits more completely

Fixes: runtime error: shift exponent 36 is too large for 32-bit type 'int'
Fixes: 2239/clusterfuzz-testcase-minimized-5639766592716800

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
23 months agoavcodec/wavpack: Change wp_log2() to unsigned
Michael Niedermayer [Fri, 9 Jun 2017 11:49:30 +0000 (13:49 +0200)]
avcodec/wavpack: Change wp_log2() to unsigned

Fixes: runtime error: signed integer overflow: 2143315325 + 4186162 cannot be represented in type 'int'
Fixes: 2134/clusterfuzz-testcase-minimized-4619258405322752

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
23 months agoavcodec/shorten: Sanity check maxnlpc
Michael Niedermayer [Fri, 9 Jun 2017 00:16:54 +0000 (02:16 +0200)]
avcodec/shorten: Sanity check maxnlpc

Fixes OOM
Fixes: 2131/clusterfuzz-testcase-minimized-4718045157130240

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2 years agoconfigure: use -x instead of -wN ..@ to strip assembly files
Rostislav Pehlivanov [Tue, 16 May 2017 11:08:37 +0000 (12:08 +0100)]
configure: use -x instead of -wN ..@ to strip assembly files

Reduces the amount of debugging information of external asm from
uselessly verbose to informative enough.

Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
Reviewed-by: James Darnley <james.darnley@gmail.com>
2 years agoavcodec/aacps: move checks for valid length outside the stereo_interpolate dsp function
James Almer [Sat, 3 Jun 2017 17:01:46 +0000 (14:01 -0300)]
avcodec/aacps: move checks for valid length outside the stereo_interpolate dsp function

Signed-off-by: James Almer <jamrial@gmail.com>
2 years agox86/vorbisdsp: optimize ff_vorbis_inverse_coupling_sse
James Almer [Fri, 16 Jun 2017 02:20:05 +0000 (23:20 -0300)]
x86/vorbisdsp: optimize ff_vorbis_inverse_coupling_sse

About 7% faster.

2 years agoavcodec/parser: assert that there is a past buffer if theres a reference into the...
Michael Niedermayer [Thu, 15 Jun 2017 23:35:35 +0000 (01:35 +0200)]
avcodec/parser: assert that there is a past buffer if theres a reference into the past

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2 years agoavcodec/truemotion2: Move skip computation after checks
Michael Niedermayer [Thu, 15 Jun 2017 21:41:46 +0000 (23:41 +0200)]
avcodec/truemotion2: Move skip computation after checks

Fixes: runtime error: signed integer overflow: 630067357 * 4 cannot be represented in type 'int'
Fixes: 2233/clusterfuzz-testcase-minimized-5943031318446080

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2 years agoavcodec/jpeg2000: Fixes integer overflow in ff_jpeg2000_ceildivpow2()
Michael Niedermayer [Thu, 15 Jun 2017 21:26:18 +0000 (23:26 +0200)]
avcodec/jpeg2000: Fixes integer overflow in ff_jpeg2000_ceildivpow2()

Fixes: runtime error: negation of -2147483648 cannot be represented in type 'int'; cast to an unsigned type to negate this value to itself
Fixes: 2231/clusterfuzz-testcase-minimized-4565181982048256

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2 years agoavcodec/dnxhd_parser: Do not return invalid value from dnxhd_find_frame_end() on...
Michael Niedermayer [Wed, 14 Jun 2017 14:58:20 +0000 (16:58 +0200)]
avcodec/dnxhd_parser: Do not return invalid value from dnxhd_find_frame_end() on error

Fixes: Null pointer dereference

Fixes: CVE-2017-9608
Found-by: Yihan Lian
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2 years agovc2enc: decrease default strictness level
Rostislav Pehlivanov [Thu, 15 Jun 2017 17:30:08 +0000 (18:30 +0100)]
vc2enc: decrease default strictness level

Given how incredibly limited the official specifications are (limiting all use
to only the most common broadcasting formats), permit all supported inputs
by default. This makes the encoder more useful.

2 years agovorbisenc: Stop tracking number of samples per frame
Tyler Jones [Wed, 14 Jun 2017 20:59:07 +0000 (14:59 -0600)]
vorbisenc: Stop tracking number of samples per frame

Each frame is now padded with 0 values if not enough samples are
present, and all frames are guaranteed to have exactly
1 << (venc->log2_blocksize[1] - 1) samples.

Signed-off-by: Tyler Jones <tdjones879@gmail.com>
Reviewed-by: Rostislav Pehlivanov <atomnuker@gmail.com>
2 years agovorbisenc: Apply and output correct length window and mdct
Tyler Jones [Wed, 14 Jun 2017 20:58:55 +0000 (14:58 -0600)]
vorbisenc: Apply and output correct length window and mdct

Usage of blocksize, window, mode, and mdct indexes are switched from
default 0 to a default of 1 to better align with specs. A flag of 0
should correspond with short windows, a flag of 1 with long.

Signed-off-by: Tyler Jones <tdjones879@gmail.com>
Reviewed-by: Rostislav Pehlivanov <atomnuker@gmail.com>
2 years agovorbisenc: Separate copying audio samples from windowing
Tyler Jones [Wed, 14 Jun 2017 20:58:22 +0000 (14:58 -0600)]
vorbisenc: Separate copying audio samples from windowing

Audio samples are shifted around when copying from the frame queue so that
analysis can be done without negatively impacting calculation of the MDCT.

Window coefficients are applied to the current two overlapped windows
simultaneously instead of applying overlap for the next frame ahead of time.
This improves readability when applying windows of varying lengths.

Signed-off-by: Tyler Jones <tdjones879@gmail.com>
Reviewed-by: Rostislav Pehlivanov <atomnuker@gmail.com>
2 years agoavfilter/af_headphone: fix possible memory leaks on failure
Paul B Mahol [Thu, 15 Jun 2017 09:19:12 +0000 (11:19 +0200)]
avfilter/af_headphone: fix possible memory leaks on failure

Signed-off-by: Paul B Mahol <onemda@gmail.com>
2 years agoavcodec/hevcdec: Check nb_sps
Michael Niedermayer [Wed, 14 Jun 2017 23:28:28 +0000 (01:28 +0200)]
avcodec/hevcdec: Check nb_sps

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2 years agoavcodec/hevc_refs: Check nb_refs in add_candidate_ref()
Michael Niedermayer [Wed, 14 Jun 2017 23:26:01 +0000 (01:26 +0200)]
avcodec/hevc_refs: Check nb_refs in add_candidate_ref()

Fixes: runtime error: index 16 out of bounds for type 'int [16]'
Fixes: 2209/clusterfuzz-testcase-minimized-5012343912136704

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2 years agoavutil/tests: remove float_dsp test
James Almer [Thu, 1 Jun 2017 22:56:17 +0000 (19:56 -0300)]
avutil/tests: remove float_dsp test

It's been ported to checkasm.

Signed-off-by: James Almer <jamrial@gmail.com>