]> git.sesse.net Git - ffmpeg/log
ffmpeg
4 years agolavfi: add an overlay_vulkan filter
Lynne [Sun, 27 Oct 2019 14:46:16 +0000 (14:46 +0000)]
lavfi: add an overlay_vulkan filter

This commit adds a basic, non-converting overlay filter for Vulkan.

4 years agolavfi: add an scale_vulkan filter
Lynne [Sun, 27 Oct 2019 14:45:36 +0000 (14:45 +0000)]
lavfi: add an scale_vulkan filter

This commit adds a basic, non-converting Vulkan scaling filter.

4 years agolavfi: add Vulkan filtering framework
Lynne [Sun, 27 Oct 2019 14:44:00 +0000 (14:44 +0000)]
lavfi: add Vulkan filtering framework

This commit adds a Vulkan filtering infrastructure for libavfilter.
It attempts to abstract as much as possible of the Vulkan API from filters.

The way the hwcontext and the framework are designed permits for parallel,
non-CPU-blocking filtering throughout, with the exception of up/downloading
and mapping.

4 years agolavfi/vf_hwupload: Add support for HW -> HW transfers
Philip Langdale [Thu, 24 Oct 2019 01:11:37 +0000 (18:11 -0700)]
lavfi/vf_hwupload: Add support for HW -> HW transfers

As we find ourselves wanting a way to transfer frames between
HW devices (or more realistically, between APIs on the same device),
it's desirable to have a way to describe the relationship. While
we could imagine introducing a `hwtransfer` filter, there is
almost no difference from `hwupload`. The main new feature we need
is a way to specify the target device. Having a single device
for the filter chain is obviously insufficient if we're dealing
with two devices.

So let's add a way to specify the upload target device, and if none
is specified, continue with the existing behaviour.

We must also correctly preserve the sw_format on such a transfer.

4 years agolavu: add Vulkan hwcontext code
Lynne [Wed, 28 Aug 2019 20:58:10 +0000 (21:58 +0100)]
lavu: add Vulkan hwcontext code

This commit adds the necessary code to initialize and use a Vulkan device
within the hwcontext libavutil framework.
Currently direct mapping to VAAPI and DRM frames is functional, and
transfers to CUDA and native frames are supported.

Lets hope the future Vulkan video decode extension fits well within this
framework.

4 years agolavu/hwcontext: Add support for HW -> HW transfers
Philip Langdale [Thu, 24 Oct 2019 01:01:52 +0000 (18:01 -0700)]
lavu/hwcontext: Add support for HW -> HW transfers

We are beginning to consider scenarios where a given HW Context
may be able to transfer frames to another HW Context without
passing via system memory - this would usually be when two
contexts represent different APIs on the same device (eg: Vulkan
and CUDA).

This is modelled as a transfer, as we have today, but where both
the src and the dst are hardware frames with hw contexts. We need
to be careful to ensure the contexts are compatible - particularly,
we cannot do transfers where one of the frames has been mapped via
a derived frames context - we can only do transfers for frames that
were directly allocated by the specified context.

Additionally, as we have two hardware contexts, the transfer function
could be implemented by either (or indeed both). To handle this
uncertainty, we explicitly look for ENOSYS as an indicator to try
the transfer in the other direction before giving up.

4 years agofate/adpcm: add adpcm_argo tests
Zane van Iperen [Tue, 4 Feb 2020 02:01:23 +0000 (02:01 +0000)]
fate/adpcm: add adpcm_argo tests

Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agolavc/dvdsubenc: accept palette from options
Michael Kuron [Mon, 3 Feb 2020 19:42:31 +0000 (20:42 +0100)]
lavc/dvdsubenc: accept palette from options

Previously, the default palette would always be used.
Now, we can accept a custom palette, just like dvdsubdec does.

Signed-off-by: Michael Kuron <michael.kuron@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agolavc/dvdsubdec: Move palette parsing to new function
Michael Kuron [Mon, 3 Feb 2020 19:42:30 +0000 (20:42 +0100)]
lavc/dvdsubdec: Move palette parsing to new function

Signed-off-by: Michael Kuron <michael.kuron@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavformat/sccdec: use av_sscanf() instead
Paul B Mahol [Tue, 4 Feb 2020 19:37:26 +0000 (20:37 +0100)]
avformat/sccdec: use av_sscanf() instead

4 years agoavfilter/vf_ssim: improve precision
Paul B Mahol [Thu, 30 Jan 2020 21:01:23 +0000 (22:01 +0100)]
avfilter/vf_ssim: improve precision

Use doubles for accumulating floats.

4 years agoavcodec/mlpenc: fix small memory leak
Paul B Mahol [Tue, 4 Feb 2020 10:35:02 +0000 (11:35 +0100)]
avcodec/mlpenc: fix small memory leak

4 years agomlp: check huff_lsbs only when codebook is used
Jai Luthra [Sun, 2 Feb 2020 19:03:00 +0000 (00:33 +0530)]
mlp: check huff_lsbs only when codebook is used

When no codebook is used, huff_lsbs can be more than 24 and still decode to
original values once filters are applied.

Signed-off-by: Jai Luthra <me@jailuthra.in>
4 years agomlpenc: fix some -fsanitize=integer errors
Jai Luthra [Sun, 2 Feb 2020 19:02:59 +0000 (00:32 +0530)]
mlpenc: fix some -fsanitize=integer errors

Signed-off-by: Jai Luthra <me@jailuthra.in>
4 years agomlpenc: clean up
Jai Luthra [Fri, 24 Jan 2020 10:33:34 +0000 (16:03 +0530)]
mlpenc: clean up

Signed-off-by: Jai Luthra <me@jailuthra.in>
4 years agomlpenc: improve lpc filtering
Jai Luthra [Fri, 24 Jan 2020 10:33:33 +0000 (16:03 +0530)]
mlpenc: improve lpc filtering

* fix a possible memory leak (apply_filter returned before freeing)
* use apply_filters in process_major_frame
* revert back to checking bounds with 24 bitdepth, as huff offset takes
care of it

Signed-off-by: Jai Luthra <me@jailuthra.in>
4 years agomlpenc: prevent negative lsb_bits lshift
Jai Luthra [Fri, 24 Jan 2020 10:33:32 +0000 (16:03 +0530)]
mlpenc: prevent negative lsb_bits lshift

Fixes Coverity CID 1396239.

Signed-off-by: Jai Luthra <me@jailuthra.in>
4 years agomlpenc: fix huff offset calculation
Jai Luthra [Fri, 24 Jan 2020 10:33:31 +0000 (16:03 +0530)]
mlpenc: fix huff offset calculation

huff offset wasn't always within the bounds before, which lead to
corrupt encoding that didn't always trigger lossless check failures

Signed-off-by: Jai Luthra <me@jailuthra.in>
4 years agomlpenc: fix lossless check error in number_sbits
Jai Luthra [Fri, 24 Jan 2020 10:33:30 +0000 (16:03 +0530)]
mlpenc: fix lossless check error in number_sbits

we need two bits instead of one bit to represent -1 in bitstream

Signed-off-by: Jai Luthra <me@jailuthra.in>
4 years agoavfilter/vf_xfade: add circleopen & circleclose transition
Paul B Mahol [Tue, 4 Feb 2020 09:27:57 +0000 (10:27 +0100)]
avfilter/vf_xfade: add circleopen & circleclose transition

4 years agoavcodec/lagarith: Sanity check scale
Michael Niedermayer [Tue, 28 Jan 2020 19:12:25 +0000 (20:12 +0100)]
avcodec/lagarith: Sanity check scale

A value of 24 and above can collaps the range to 0 which would not work.

Fixes: Timeout (75sec -> 21sec)
Fixes: 18707/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_LAGARITH_fuzzer-5708950892969984
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavcodec/pngdec: Check amount decoded
Michael Niedermayer [Sat, 17 Aug 2019 21:55:34 +0000 (23:55 +0200)]
avcodec/pngdec: Check amount decoded

Fixes: Timeout (70sec -> 243ms)
Fixes: 16097/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_APNG_fuzzer-5664690889293824
Fixes: 16927/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_APNG_fuzzer-5170612070252544
Fixes: 16927/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_APNG_fuzzer-5706325622784000
Fixes: 18705/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_APNG_fuzzer-5650989302677504
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavcodec/apedec: Fix integer overflows in predictor_decode_mono_3950()
Michael Niedermayer [Tue, 28 Jan 2020 17:35:43 +0000 (18:35 +0100)]
avcodec/apedec: Fix integer overflows in predictor_decode_mono_3950()

Fixes: signed integer overflow: -2147407150 + -1871606 cannot be represented in type 'int'
Fixes: 18702/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_APE_fuzzer-5679095417667584
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agodoc: Fix typo for dvdsubdec
Michael Kuron [Mon, 3 Feb 2020 19:42:29 +0000 (20:42 +0100)]
doc: Fix typo for dvdsubdec

Signed-off-by: Michael Kuron <michael.kuron@gmail.com>
4 years agoavformat/dashenc: use AV_OPT_TYPE_DICT for http_opts
Marton Balint [Sun, 2 Feb 2020 21:58:08 +0000 (22:58 +0100)]
avformat/dashenc: use AV_OPT_TYPE_DICT for http_opts

This changes the separator character from comma to colon, but since this option
was only added recently I think it should be done for consistency with other
similar options.

Signed-off-by: Marton Balint <cus@passwd.hu>
4 years agoavcodec/libvpxenc: add VP9 temporal scalability encoding option
Wonkap Jang [Mon, 3 Feb 2020 18:02:01 +0000 (10:02 -0800)]
avcodec/libvpxenc: add VP9 temporal scalability encoding option

This commit reuses the configuration options for VP8 that enables
temporal scalability for VP9. It also adds a way to enable three
preset temporal structures (refer to the documentation for more
detail) that can be used in offline encoding.

Signed-off-by: James Zern <jzern@google.com>
4 years agoavfilter/vf_xfade_opencl: move passthrough code before eof check
Paul B Mahol [Mon, 3 Feb 2020 08:40:46 +0000 (09:40 +0100)]
avfilter/vf_xfade_opencl: move passthrough code before eof check

4 years agoavfilter/vf_xfade: move passthrough code before eof check
Paul B Mahol [Mon, 3 Feb 2020 08:36:52 +0000 (09:36 +0100)]
avfilter/vf_xfade: move passthrough code before eof check

4 years agoMAINTAINERS: Add myself as mxf* maintainer
Tomas Härdin [Sat, 1 Feb 2020 15:15:53 +0000 (16:15 +0100)]
MAINTAINERS: Add myself as mxf* maintainer

I have more time for this these days

4 years agoavcodec/ralf: Fix integer overflow in apply_lpc()
Michael Niedermayer [Sun, 8 Dec 2019 12:48:45 +0000 (13:48 +0100)]
avcodec/ralf: Fix integer overflow in apply_lpc()

Fixes: signed integer overflow: 2147482897 + 2048 cannot be represented in type 'int'
Fixes: 19240/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_RALF_fuzzer-5743240326414336
Fixes: 19869/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_RALF_fuzzer-5150136636538880
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavcodec/dca_lbr: Fix some error codes and error passing
Michael Niedermayer [Sat, 4 Jan 2020 22:01:12 +0000 (23:01 +0100)]
avcodec/dca_lbr: Fix some error codes and error passing

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavcodec/8svx: Use av_assert1(0) instead of error message in unreachable code
Michael Niedermayer [Sun, 29 Dec 2019 14:11:33 +0000 (15:11 +0100)]
avcodec/8svx: Use av_assert1(0) instead of error message in unreachable code

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavcodec/wmavoice: Fix rounding and integer anomalies in calc_input_response()
Michael Niedermayer [Sat, 14 Dec 2019 14:27:44 +0000 (15:27 +0100)]
avcodec/wmavoice: Fix rounding and integer anomalies in calc_input_response()

Fixes: out of array access
Fixes: inf is outside the range of representable values of type 'int'
Fixes: signed integer overflow: -9223372036854775808 - 1 cannot be represented in type 'long'
Fixes: 19316/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_WMAVOICE_fuzzer-5677369365102592
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavcodec/wmavoice: sanity check block_align
Michael Niedermayer [Sat, 21 Dec 2019 21:27:37 +0000 (22:27 +0100)]
avcodec/wmavoice: sanity check block_align

This limit is roughly based on the bitreader limit, its likely a much tighter limit
could be used

Fixes: left shift of 1965039647 by 1 places cannot be represented in type 'int'
Fixes: 19545/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_WMAVOICE_fuzzer-5695391899320320
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavcodec/pcm: Fix invalid shift in pcm_decode_frame for LXF
Michael Niedermayer [Tue, 17 Dec 2019 23:07:50 +0000 (00:07 +0100)]
avcodec/pcm: Fix invalid shift in pcm_decode_frame for LXF

Fixes: left shift of 32 by 28 places cannot be represented in type 'int'
Fixes: 19472/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_PCM_LXF_fuzzer-5704364320096256
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavcodec/snappy: Sanity check bytestream2_get_levarint()
Michael Niedermayer [Sun, 19 Jan 2020 20:51:11 +0000 (21:51 +0100)]
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>
4 years agoavformat/udp: cancel pending IO on win32 manually
Marton Balint [Sun, 26 Jan 2020 21:13:50 +0000 (22:13 +0100)]
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>
4 years agoavformat/udp: remove setting cancel state from the TX thread
Marton Balint [Sun, 26 Jan 2020 20:11:53 +0000 (21:11 +0100)]
avformat/udp: remove setting cancel state from the TX thread

Write mode does not use cancellation.

Signed-off-by: Marton Balint <cus@passwd.hu>
4 years agoavcodec/mlpdsp: Fix a invalid shift in ff_mlp_rematrix_channel()
Michael Niedermayer [Sat, 1 Feb 2020 22:25:42 +0000 (23:25 +0100)]
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>
4 years agoavcodec/adpcm_argo: simplify and move duplicated logic into a function
Zane van Iperen [Sat, 1 Feb 2020 06:59:59 +0000 (06:59 +0000)]
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>
4 years agoavfilter: add xfade opencl filter
Paul B Mahol [Thu, 23 Jan 2020 15:29:34 +0000 (16:29 +0100)]
avfilter: add xfade opencl filter

4 years agodoc/filters: fix tonemap_vaapi filter name in documentation
Paul B Mahol [Sun, 2 Feb 2020 09:06:19 +0000 (10:06 +0100)]
doc/filters: fix tonemap_vaapi filter name in documentation

4 years agodoc/filters: make filters order more consistent
Paul B Mahol [Sun, 2 Feb 2020 09:04:35 +0000 (10:04 +0100)]
doc/filters: make filters order more consistent

4 years agoavcodec/v4l2_m2m: Cosmetics
Andriy Gelman [Mon, 13 Jan 2020 04:11:30 +0000 (23:11 -0500)]
avcodec/v4l2_m2m: Cosmetics

Change pointer symbol position.

Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com>
4 years agoavcodec/v4l2_m2m: Use consistent logging context
Andriy Gelman [Mon, 13 Jan 2020 04:11:29 +0000 (23:11 -0500)]
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>
4 years agoavcodec/v4l2_m2m: Simplify capture buffer init check
Andriy Gelman [Mon, 13 Jan 2020 04:11:27 +0000 (23:11 -0500)]
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>
4 years agoavcodec:v4l2_context: Remove NULL initialization
Andriy Gelman [Mon, 13 Jan 2020 04:11:26 +0000 (23:11 -0500)]
avcodec:v4l2_context: Remove NULL initialization

Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com>
4 years agoavfilter/vf_xfade: remove unused header
Paul B Mahol [Sat, 1 Feb 2020 21:06:11 +0000 (22:06 +0100)]
avfilter/vf_xfade: remove unused header

4 years agoavfilter/vf_psnr: fix logic failure when comparing time bases
Paul B Mahol [Sat, 1 Feb 2020 20:10:25 +0000 (21:10 +0100)]
avfilter/vf_psnr: fix logic failure when comparing time bases

4 years agoavfilter/vf_ssim: fix logic failure when comparing time bases
Paul B Mahol [Sat, 1 Feb 2020 20:09:32 +0000 (21:09 +0100)]
avfilter/vf_ssim: fix logic failure when comparing time bases

4 years agoavcodec/utils: remove extra brackets
leozhang [Sat, 1 Feb 2020 09:12:13 +0000 (17:12 +0800)]
avcodec/utils: remove extra brackets

Signed-off-by: leozhang <leozhang@qiyi.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agolibavcodec/amfenc_hevc.c: Fix constant QP settings for I, P
OvchinnikovDmitrii [Tue, 28 Jan 2020 16:23:43 +0000 (19:23 +0300)]
libavcodec/amfenc_hevc.c: Fix constant QP settings for I, P

4 years agolavc/h265_profile_level: Fix the default profile in ff_h265_guess_level
Linjie Fu [Wed, 15 Jan 2020 06:54:43 +0000 (14:54 +0800)]
lavc/h265_profile_level: Fix the default profile in ff_h265_guess_level

Default to using multiplication factors for Main profile.

Introduced since cd3578a8e4e11e0ba021e621367a7974d6de5da0.

Signed-off-by: Linjie Fu <linjie.fu@intel.com>
4 years agoavformat/hlsenc: fix hls_ts_options with mpegts
Marton Balint [Mon, 23 Dec 2019 00:27:38 +0000 (01:27 +0100)]
avformat/hlsenc: fix hls_ts_options with mpegts

Was broken since cdbf8847ea97a985dfd55432e1384bb7fe5d2d3b.

Signed-off-by: Marton Balint <cus@passwd.hu>
4 years agoavfilter/vf_geq: use per-thread AVExpr for expression evaluation
Marton Balint [Sat, 28 Dec 2019 13:50:12 +0000 (14:50 +0100)]
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>
4 years agoavcodec/avdct: Clear IDCTDSPContext context
Michael Niedermayer [Mon, 27 Jan 2020 20:54:22 +0000 (21:54 +0100)]
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>
4 years agoMAINTAINERS: Add patchwork maintainer
Michael Niedermayer [Mon, 27 Jan 2020 20:54:21 +0000 (21:54 +0100)]
MAINTAINERS: Add patchwork maintainer

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agodashenc: check pts to prevent division by zero error
Alfred E. Heggestad [Thu, 30 Jan 2020 09:58:01 +0000 (10:58 +0100)]
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>
4 years agoavfilter/vf_xfade: add smooth transitions
Paul B Mahol [Fri, 31 Jan 2020 12:14:13 +0000 (13:14 +0100)]
avfilter/vf_xfade: add smooth transitions

4 years agodoc/filters: improve xfade description and add one example
Paul B Mahol [Fri, 31 Jan 2020 09:17:05 +0000 (10:17 +0100)]
doc/filters: improve xfade description and add one example

4 years agoavfilter/vf_drawtext: do not overread text if the last UTF8 sequence is invalid
Marton Balint [Wed, 29 Jan 2020 22:55:25 +0000 (23:55 +0100)]
avfilter/vf_drawtext: do not overread text if the last UTF8 sequence is invalid

Signed-off-by: Marton Balint <cus@passwd.hu>
4 years agoavfilter/vf_drawtext: use replacement chars for invalid UTF8 sequences
Marton Balint [Wed, 29 Jan 2020 22:29:04 +0000 (23:29 +0100)]
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>
4 years agoavutil/common: warn about possible move of the data pointer after the last 0 byte...
Marton Balint [Wed, 29 Jan 2020 22:56:07 +0000 (23:56 +0100)]
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>
4 years agoavutil/common: put ERROR statements into separate code blocks in GET_UTF8/16
Marton Balint [Wed, 29 Jan 2020 22:42:21 +0000 (23:42 +0100)]
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>
4 years agoavutil/common: add parenthesis around GET_16BIT in GET_UTF16
Marton Balint [Wed, 29 Jan 2020 21:41:50 +0000 (22:41 +0100)]
avutil/common: add parenthesis around GET_16BIT in GET_UTF16

Signed-off-by: Marton Balint <cus@passwd.hu>
4 years agoavutil/common: use unsigned int in GET_UTF8
Marton Balint [Wed, 29 Jan 2020 21:40:42 +0000 (22:40 +0100)]
avutil/common: use unsigned int in GET_UTF8

Right shift of signed value is implementation defined.

Signed-off-by: Marton Balint <cus@passwd.hu>
4 years agoavcodec/x86/diracdsp: Fix high bits on Windows x86_64
Michael Niedermayer [Thu, 30 Jan 2020 21:04:06 +0000 (22:04 +0100)]
avcodec/x86/diracdsp: Fix high bits on Windows x86_64

Found-by: james
4 years agotests/fate/lavf-video.mak: fix fate-lavf-gif dependencies
Michael Niedermayer [Mon, 6 Jan 2020 12:43:10 +0000 (13:43 +0100)]
tests/fate/lavf-video.mak: fix fate-lavf-gif dependencies

The gif test should depend on gif not fits
Regression since: ac4b5d86222006fa71ffe5922e1a34f1422507d8

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavcodec/ralf: Fix overflows of biased values
Michael Niedermayer [Thu, 26 Dec 2019 23:11:59 +0000 (00:11 +0100)]
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>
4 years agotools/target_dec_fuzzer: limit per frame samples for APE
Michael Niedermayer [Fri, 10 Jan 2020 21:39:47 +0000 (22:39 +0100)]
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>
4 years agoavformat/mov: Check STCO location
Michael Niedermayer [Sat, 11 Jan 2020 11:09:08 +0000 (12:09 +0100)]
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>
4 years agoavcodec/wmalosslessdec: Fix multiple integer overflows
Michael Niedermayer [Thu, 9 Jan 2020 01:06:36 +0000 (02:06 +0100)]
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>
4 years agoavcodec/apedec: Fix undefined integer overflow in decode_array_0000()
Michael Niedermayer [Sat, 7 Dec 2019 19:55:16 +0000 (20:55 +0100)]
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>
4 years agoremove tests/ref/lavf/fits
Michael Niedermayer [Mon, 6 Jan 2020 12:38:33 +0000 (13:38 +0100)]
remove tests/ref/lavf/fits

This appears to be forgotten in ac4b5d86222006fa71ffe5922e1a34f1422507d8

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavcodec/smacker: Check space before decoding type
Michael Niedermayer [Wed, 1 Jan 2020 19:43:05 +0000 (20:43 +0100)]
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>
4 years agoavcodec/rawdec: Use linesize in b64a
Michael Niedermayer [Wed, 1 Jan 2020 21:32:04 +0000 (22:32 +0100)]
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>
4 years agoavcodec/iff: Over-allocate ham_palbuf for HAM6 IFF-PBM
Michael Niedermayer [Fri, 3 Jan 2020 22:24:15 +0000 (23:24 +0100)]
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>
4 years agodoc/filters: Document geq *sum functions
Michael Niedermayer [Sat, 28 Dec 2019 10:26:10 +0000 (11:26 +0100)]
doc/filters: Document geq *sum functions

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agotools/target_dec_fuzzer: Add threshold for ALS
Michael Niedermayer [Sat, 25 Jan 2020 18:53:49 +0000 (19:53 +0100)]
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>
4 years agoavcodec/x86/diracdsp: Fix incorrect src addressing in dequant_subband_32()
Michael Niedermayer [Wed, 29 Jan 2020 21:11:45 +0000 (22:11 +0100)]
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>
4 years agoavcodec/screenpresso: Optimize sum_delta_flipped()
Michael Niedermayer [Wed, 29 Jan 2020 18:20:29 +0000 (19:20 +0100)]
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>
4 years agoavformat/aviobuf: Remove AVIOInternal and one level of indirection
Andreas Rheinhardt [Mon, 6 Jan 2020 14:51:48 +0000 (15:51 +0100)]
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>
4 years agoavfilter/vf_xfade: add radial transition
Paul B Mahol [Thu, 30 Jan 2020 16:20:31 +0000 (17:20 +0100)]
avfilter/vf_xfade: add radial transition

4 years agocmdutils: fix crash if no name for "ffmpeg -h protocol"
Jun Zhao [Thu, 30 Jan 2020 14:03:17 +0000 (22:03 +0800)]
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>
4 years agoavfilter: add xfade filter
Paul B Mahol [Wed, 23 Oct 2019 18:43:26 +0000 (20:43 +0200)]
avfilter: add xfade filter

4 years agocmdutils: add show_help_protocol for get protocol options
Steven Liu [Wed, 27 Nov 2019 05:57:02 +0000 (13:57 +0800)]
cmdutils: add show_help_protocol for get protocol options

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
4 years agoavformat/avio: add avio_protocol_get_class
Steven Liu [Thu, 30 Jan 2020 09:03:48 +0000 (17:03 +0800)]
avformat/avio: add avio_protocol_get_class

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Suggested-by: Hendrik Leppkes <h.leppkes@gmail.com>
Suggested-by: Nicolas George <george@nsup.org>
Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
4 years agoavformat/tty: add probe function
Paul B Mahol [Mon, 27 Jan 2020 20:53:08 +0000 (21:53 +0100)]
avformat/tty: add probe function

4 years agoavfilter/vf_geq: fix multiple assignments of ptr in slice_geq_filter
Marton Balint [Sat, 28 Dec 2019 14:05:43 +0000 (15:05 +0100)]
avfilter/vf_geq: fix multiple assignments of ptr in slice_geq_filter

Fixes Coverity CID 1427183.

Signed-off-by: Marton Balint <cus@passwd.hu>
4 years agotools/target_dec_fuzzer: Add threshold for IFF_ILBM
Michael Niedermayer [Wed, 22 Jan 2020 22:51:09 +0000 (23:51 +0100)]
tools/target_dec_fuzzer: Add threshold for IFF_ILBM

Fixes: Timeout (32 -> 1sec)
Fixes: 20138/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_IFF_ILBM_fuzzer-5634665251864576
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Peter Ross <pross@xvid.org>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agotools/target_dec_fuzzer: Sort threshold list alphabetically
Michael Niedermayer [Sat, 25 Jan 2020 23:56:25 +0000 (00:56 +0100)]
tools/target_dec_fuzzer: Sort threshold list alphabetically

This also removes the comments as they are hard to maintain
together with sorted lists

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavcodec/dnxhddec: properly set colorspace
Paul B Mahol [Fri, 24 Jan 2020 12:30:24 +0000 (13:30 +0100)]
avcodec/dnxhddec: properly set colorspace

4 years agoRevert "fate/filter-video: add two tests for dnn_processing with frame format rgb24...
Guo, Yejun [Wed, 29 Jan 2020 00:15:28 +0000 (01:15 +0100)]
Revert "fate/filter-video: add two tests for dnn_processing with frame format rgb24 and grayf32"

The tests broke fate without SAMPLES and fate on some platforms.
This reverts commit 95ade711eb4afb8b76a765ef6571e7934ad7f8cc.

4 years agoavformat/mov: Don't leak MOVFragmentStreamInfo on error
Andreas Rheinhardt [Mon, 27 Jan 2020 08:28:19 +0000 (09:28 +0100)]
avformat/mov: Don't leak MOVFragmentStreamInfo on error

Fixes Coverity issue #1441933.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavformat/mov: Free encryption data on error
Andreas Rheinhardt [Mon, 27 Jan 2020 08:28:18 +0000 (09:28 +0100)]
avformat/mov: Free encryption data on error

Fixes memleak and Coverity issue #1439587.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavfilter/asrc_sinc: Don't allocate arrays separately
Andreas Rheinhardt [Mon, 27 Jan 2020 06:00:48 +0000 (07:00 +0100)]
avfilter/asrc_sinc: Don't allocate arrays separately

Besides the obvious advantages this also fixes a potential memleak:
If only one of the arrays had been successfully allocated, the other
would leak. This also fixes Coverity issues #1440386 and #1440387.

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>
4 years agoavformat/mov: update extensions
Gyan Doshi [Mon, 27 Jan 2020 08:46:50 +0000 (14:16 +0530)]
avformat/mov: update extensions

Added all extensions used by the mov muxer family, except m4v which
is also used for raw MPEG-4 Part 2 bitstreams

4 years agotest/fate: Add missing exe suffix to h265_levels test.
Carl Eugen Hoyos [Mon, 27 Jan 2020 23:02:01 +0000 (00:02 +0100)]
test/fate: Add missing exe suffix to h265_levels test.

Fixes fate on WSL using mingw.

4 years agoffmpeg: Do not print "SDP:" on top of sdp files.
Carl Eugen Hoyos [Sun, 26 Jan 2020 20:47:26 +0000 (21:47 +0100)]
ffmpeg: Do not print "SDP:" on top of sdp files.

Fixes ticket #7068.

4 years agoavformat/matroskaenc: Remove useless AVIOContext
Andreas Rheinhardt [Wed, 1 Jan 2020 00:58:20 +0000 (01:58 +0100)]
avformat/matroskaenc: Remove useless AVIOContext

Write a few numbers directly via AV_WB32 instead of using an AVIOContext
(that is initialized only for this very purpose) to write these numbers
at known offsets into a fixed buffer.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>