Commit Graph

96842 Commits

Author SHA1 Message Date
Michael Niedermayer be54da2117 avcodec/snappy: Sanity check bytestream2_get_levarint()
Fixes: left shift of 79 by 28 places cannot be represented in type 'int'
Fixes: 20202/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_HAP_fuzzer-5719004081815552
Fixes: 20219/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_HAP_fuzzer-5641738677125120
Fixes: 20389/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_HAP_fuzzer-5680721517871104

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-02-03 00:11:18 +01:00
Marton Balint 53aa76686e avformat/udp: cancel pending IO on win32 manually
recvfrom() is not a cancellation point in pthreads-win32, see
https://sourceware.org/pthreads-win32/manual/pthread_cancel.html

In order to be able to cancel the reader thread on Win32 properly we first
shutdown the socket then call CancelIoEx to abort pending IO. Subsequent
recvfrom() calls will fail with WSAESHUTDOWN causing the thread to exit.

Fixes ticket #5717.

Signed-off-by: Marton Balint <cus@passwd.hu>
2020-02-02 19:04:42 +01:00
Marton Balint c2b6493bf7 avformat/udp: remove setting cancel state from the TX thread
Write mode does not use cancellation.

Signed-off-by: Marton Balint <cus@passwd.hu>
2020-02-02 19:04:42 +01:00
Michael Niedermayer fcc9f13717 avcodec/mlpdsp: Fix a invalid shift in ff_mlp_rematrix_channel()
Fixes: left shift of negative value -2
Fixes: 20305/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TRUEHD_fuzzer-5677196618498048

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Jai Luthra <me@jailuthra.in>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-02-02 17:09:14 +01:00
Zane van Iperen b49404ea30 avcodec/adpcm_argo: simplify and move duplicated logic into a function
Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-02-02 17:09:14 +01:00
Paul B Mahol cd823dadf9 avfilter: add xfade opencl filter 2020-02-02 14:08:56 +01:00
Paul B Mahol 84286789e6 doc/filters: fix tonemap_vaapi filter name in documentation 2020-02-02 10:18:50 +01:00
Paul B Mahol 69477e10f0 doc/filters: make filters order more consistent 2020-02-02 10:18:50 +01:00
Andriy Gelman d85c84eb38 avcodec/v4l2_m2m: Cosmetics
Change pointer symbol position.

Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com>
2020-02-01 21:39:05 +00:00
Andriy Gelman 73e23b404c avcodec/v4l2_m2m: Use consistent logging context
Before this commit v4l2_m2m used two different logging contexts (from
V4L2m2mPriv and AVCodecContext). For consistency always use AVCodecContext.

Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com>
2020-02-01 21:39:05 +00:00
Andriy Gelman 4c1a3e9166 avcodec/v4l2_m2m: Simplify capture buffer init check
Before this commit s->avctx == NULL was used to infer that an encoder is
being initialzed. Code readability has been improved by directly using
!av_codec_is_decoder() instead.

Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com>
2020-02-01 21:39:05 +00:00
Andriy Gelman 3905ecbc06 avcodec:v4l2_context: Remove NULL initialization
Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com>
2020-02-01 21:39:05 +00:00
Paul B Mahol e5e7289ea8 avfilter/vf_xfade: remove unused header 2020-02-01 22:06:11 +01:00
Paul B Mahol 5c9a4ff8c1 avfilter/vf_psnr: fix logic failure when comparing time bases 2020-02-01 21:10:25 +01:00
Paul B Mahol 89eee09739 avfilter/vf_ssim: fix logic failure when comparing time bases 2020-02-01 21:09:32 +01:00
leozhang 81d25e5bfc avcodec/utils: remove extra brackets
Signed-off-by: leozhang <leozhang@qiyi.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-02-01 19:04:50 +01:00
OvchinnikovDmitrii 843c24a400 libavcodec/amfenc_hevc.c: Fix constant QP settings for I, P 2020-02-01 14:32:08 +00:00
Linjie Fu f0287e120a lavc/h265_profile_level: Fix the default profile in ff_h265_guess_level
Default to using multiplication factors for Main profile.

Introduced since cd3578a8e4.

Signed-off-by: Linjie Fu <linjie.fu@intel.com>
2020-02-01 13:38:34 +00:00
Marton Balint 73aab08d9d avformat/hlsenc: fix hls_ts_options with mpegts
Was broken since cdbf8847ea.

Signed-off-by: Marton Balint <cus@passwd.hu>
2020-01-31 22:49:55 +01:00
Marton Balint c044ac2071 avfilter/vf_geq: use per-thread AVExpr for expression evaluation
There was no consensus about separating AVExprState from AVExpr so here is a
minimal patch using the existing AVExpr to fix ticket #7528.

Signed-off-by: Marton Balint <cus@passwd.hu>
2020-01-31 22:47:49 +01:00
Michael Niedermayer b82825eba8 avcodec/avdct: Clear IDCTDSPContext context
Fixes use of uninitialized variable and segfault

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-01-31 22:17:09 +01:00
Michael Niedermayer c2d4762922 MAINTAINERS: Add patchwork maintainer
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-01-31 22:17:09 +01:00
Alfred E. Heggestad d550a28560 dashenc: check pts to prevent division by zero error
this usecase will cause a division by zero trap:

1. dashenc has received one frame
2. os->max_pts and os->start_pts have same value
3. delta between max_pts and start_pts is 0
4. av_rescale_q(0, x, y) returns 0
5. this value is used as denominator in division
6. Bang! -> segfault

this fix checks that max_pts > start_pts.
the fix has been tested and works.

Signed-off-by: Alfred E. Heggestad <alfred.heggestad@gmail.com>
Reviewed-by: Jeyapal, Karthick <kjeyapal@akamai.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2020-01-31 10:15:37 -03:00
Paul B Mahol 53b4128ea0 avfilter/vf_xfade: add smooth transitions 2020-01-31 13:14:13 +01:00
Paul B Mahol 113bae5985 doc/filters: improve xfade description and add one example 2020-01-31 10:17:05 +01:00
Marton Balint 62d92a878d avfilter/vf_drawtext: do not overread text if the last UTF8 sequence is invalid
Signed-off-by: Marton Balint <cus@passwd.hu>
2020-01-31 00:15:13 +01:00
Marton Balint 5ac8389cfa avfilter/vf_drawtext: use replacement chars for invalid UTF8 sequences
continue is explicitly disallowed for GET_UTF8, so let's fix that as well.
Fixes crash with invalid UTF8 sequences.

Signed-off-by: Marton Balint <cus@passwd.hu>
2020-01-31 00:15:13 +01:00
Marton Balint 6026384047 avutil/common: warn about possible move of the data pointer after the last 0 byte in GET_UTF8
Signed-off-by: Marton Balint <cus@passwd.hu>
2020-01-31 00:15:13 +01:00
Marton Balint d9f5fe4ed7 avutil/common: put ERROR statements into separate code blocks in GET_UTF8/16
To be able to safely use more than one statement in ERROR.

Signed-off-by: Marton Balint <cus@passwd.hu>
2020-01-31 00:15:13 +01:00
Marton Balint 1466bb0bad avutil/common: add parenthesis around GET_16BIT in GET_UTF16
Signed-off-by: Marton Balint <cus@passwd.hu>
2020-01-31 00:15:13 +01:00
Marton Balint 5df1c1ad9a avutil/common: use unsigned int in GET_UTF8
Right shift of signed value is implementation defined.

Signed-off-by: Marton Balint <cus@passwd.hu>
2020-01-31 00:15:12 +01:00
Michael Niedermayer 24af459d1e avcodec/x86/diracdsp: Fix high bits on Windows x86_64
Found-by: james
2020-01-31 00:04:22 +01:00
Michael Niedermayer 24a5e873b3 tests/fate/lavf-video.mak: fix fate-lavf-gif dependencies
The gif test should depend on gif not fits
Regression since: ac4b5d8622

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-01-30 20:30:36 +01:00
Michael Niedermayer a71794e8c2 avcodec/ralf: Fix overflows of biased values
Fixes: signed integer overflow: 2003010644 * 2 cannot be represented in type 'int'
Fixes: 19593/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_RALF_fuzzer-5660628006207488

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-01-30 19:59:48 +01:00
Michael Niedermayer 32522b5307 tools/target_dec_fuzzer: limit per frame samples for APE
APE in its highest compression mode is really slow so even one frame
of millions of samples takes a long time

Fixes: Timeout (too long -> 3sec)
Fixes: 19937/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_APE_fuzzer-5751668818051072

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-01-30 19:59:10 +01:00
Michael Niedermayer 1cd4184020 avformat/mov: Check STCO location
Fixes: bypassing of checks and assertion failure
Fixes: asan_1003879.mp4

Found-by: Clusterfuzz + asan
Reported-by: Thomas Guilbert <tguilbert@google.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-01-30 19:58:45 +01:00
Michael Niedermayer 422202516c avcodec/wmalosslessdec: Fix multiple integer overflows
Fixes: left shift of 3329 by 20 places cannot be represented in type 'int'
Fixes: signed integer overflow: -199378355 + -1948950833 cannot be represented in type 'int'
Fixes: 19837/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_WMALOSSLESS_fuzzer-5752565837070336
Fixes: 19839/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_WMALOSSLESS_fuzzer-5767483265122304

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-01-30 19:58:22 +01:00
Michael Niedermayer a3655bb02c avcodec/apedec: Fix undefined integer overflow in decode_array_0000()
Fixes: signed integer overflow: -2143289344 - 6246400 cannot be represented in type 'int'
Fixes: 19239/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_APE_fuzzer-5173755680915456

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-01-30 19:58:15 +01:00
Michael Niedermayer 07754f3f8f remove tests/ref/lavf/fits
This appears to be forgotten in ac4b5d8622

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-01-30 19:57:58 +01:00
Michael Niedermayer 6f5c18da59 avcodec/smacker: Check space before decoding type
Fixes: Timeout (232sec -> 280ms)
Fixes: 19682/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SMACKER_fuzzer-5654129649385472

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-01-30 19:57:34 +01:00
Michael Niedermayer 2b5b9d5dac avcodec/rawdec: Use linesize in b64a
Fixes: out of array access
Fixes: 19750/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_RAWVIDEO_fuzzer-5074834119983104

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-01-30 19:57:25 +01:00
Michael Niedermayer 8652f4e7a1 avcodec/iff: Over-allocate ham_palbuf for HAM6 IFF-PBM
IFF-PBM-HAM6 can read out of array without this overallocation
Fixes: Out of array read
Fixes: 19752/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_IFF_ILBM_fuzzer-5675331403120640

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-01-30 19:56:25 +01:00
Michael Niedermayer d4b05f31d8 doc/filters: Document geq *sum functions
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-01-30 19:55:36 +01:00
Michael Niedermayer 48b6947821 tools/target_dec_fuzzer: Add threshold for ALS
Fixes: Timeout (253sec -> 16sec)
Fixes: 18668/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ALS_fuzzer-6227155369590784

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-01-30 19:40:26 +01:00
Michael Niedermayer 0694b60b7b avcodec/x86/diracdsp: Fix incorrect src addressing in dequant_subband_32()
Fixes: Segfault (not reproducable with asm, which made this hard to debug)
Fixes: decoding errors
Fixes: 19854/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_DIRAC_fuzzer-5729372837511168

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-01-30 18:47:21 +01:00
Michael Niedermayer 20916f9bc4 avcodec/screenpresso: Optimize sum_delta_flipped()
553 -> 332 sec

Testcase: 20280/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SCREENPRESSO_fuzzer-6238663432470528

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-01-30 18:47:21 +01:00
Andreas Rheinhardt 6e8e8431e1 avformat/aviobuf: Remove AVIOInternal and one level of indirection
In the Libav commit cae448cf, the opaque of every AVIOContext opened
by ffio_fdopen() (which is used internally by avio_open() and avio_open2())
changed: It was a simple pointer to an URLContext before, but now it was
a structure (namely AVIOInternal) containing a pointer to an URLContext
as its only member. The next commits (namely 8c0ceafb and ec4c4839) added
members to AVIOInternal to allow white-/blacklisting of protocols.

But these two commits were never merged into FFmpeg (they were only
merged as no-ops in 510046c2 and 063b26d3), because FFmpeg chose
a different way to implement this (in 93629735); and so our AVIOInternal
still has exactly one member.

This of course means that it is unnecessary to use AVIOInternal as
opaque as it is just adding a level of indirection (not only pointer
dereference, but also wrapper functions). Therefore this commit
removes AVIOInternal entirely and essentially reverts cae448cf.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-01-30 18:47:21 +01:00
Paul B Mahol 0a275fec62 avfilter/vf_xfade: add radial transition 2020-01-30 17:29:31 +01:00
Jun Zhao b99ed6e428 cmdutils: fix crash if no name for "ffmpeg -h protocol"
fix crash when used the command like:
- ffmpeg -h protocol
- ffmpeg -h protocol=

Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2020-01-30 12:50:22 -03:00
Paul B Mahol 863accbefa avfilter: add xfade filter 2020-01-30 16:35:33 +01:00