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

107475 Commits

Author SHA1 Message Date
Tomas Härdin
1ee994e168 libavcodec/jpeg2000_parser: Speed up long skips 2022-06-10 10:50:12 +02:00
Gijs Peskens
7f3f3539e8 avformat/librist: allow setting fifo size and fail on overflow
Introduce fifo_size and overrun_nonfatal params to configure fifo buffer
behavior.

Use newly introduced RIST_DATA_FLAGS_OVERFLOW flag to check for overrun
and error out in that case.

Signed-off-by: Marton Balint <cus@passwd.hu>
2022-06-09 23:57:20 +02:00
Stefano Sabatini
605b4016b3 ffmpeg: drop undocumented -d option
Option was added in commit 39aafa5ee9 but was never documented.

Also does not seem there are current use cases for it,
tests for which it was introduced are still working therefore we drop
it altogether.

Indirectly fix trac issue: http://trac.ffmpeg.org/ticket/1698

Signed-off-by: Marton Balint <cus@passwd.hu>
2022-06-09 21:12:16 +02:00
Michael Niedermayer
c4b130e876 avformat/aviobuf: Check buf_size in ffio_ensure_seekback()
buffer_size is an int

Fixes: signed integer overflow: 9223372036854775754 + 32767 cannot be represented in type 'long'
Fixes: 45691/clusterfuzz-testcase-minimized-ffmpeg_IO_DEMUXER_fuzzer-5263458831040512

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2022-06-09 20:46:21 +02:00
Michael Niedermayer
35dc93ab44 avformat/bfi: Check offsets better
Fixes: signed integer overflow: -2145378272 - 538976288 cannot be represented in type 'int'
Fixes: 45690/clusterfuzz-testcase-minimized-ffmpeg_IO_DEMUXER_fuzzer-5015496544616448

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2022-06-09 20:46:10 +02:00
Michael Niedermayer
ffc8772150 avformat/asfdec_f: Check packet_frag_timestamp
Fixes: signed integer overflow: -9223372036854775808 - 4607 cannot be represented in type 'long'
Fixes: 45685/clusterfuzz-testcase-minimized-ffmpeg_IO_DEMUXER_fuzzer-5280102802391040

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2022-06-09 20:45:36 +02:00
Michael Niedermayer
5d6cdb015e avcodec/wmalosslessdec: Check channels after setting them
Fixes: 46194/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_WMALOSSLESS_fuzzer-580292873827123
Fixes: stack-buffer-overflow on address 0x7ffc0ce69b30 at pc 0x00000062fb03 bp 0x7ffc0ce69af0 sp 0x7ffc0ce69ae8
Fixes: 46205/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_WMALOSSLESS_fuzzer-5354894996930560
Fixes: 47861/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_WMALOSSLESS_fuzzer-4817404984688640

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2022-06-09 20:44:26 +02:00
softworkz
5d5a014199 avformat/file: remove _WIN32 condition
stat is now re-mapped with long path support
in os_support.h

Signed-off-by: softworkz <softworkz@hotmail.com>
Signed-off-by: Martin Storsjö <martin@martin.st>
2022-06-09 13:03:55 +03:00
softworkz
bc8f1bbe23 avformat/os_support: Support long file names on Windows
Signed-off-by: softworkz <softworkz@hotmail.com>
Signed-off-by: Martin Storsjö <martin@martin.st>
2022-06-09 13:03:51 +03:00
softworkz
c5aba39a04 avutil/wchar_filename,file_open: Support long file names on Windows
Signed-off-by: softworkz <softworkz@hotmail.com>
Signed-off-by: Martin Storsjö <martin@martin.st>
2022-06-09 13:03:47 +03:00
Stefano Sabatini
7adeeff91f ffprobe: update entry index after printing packet/media type
Fix JSON output in case a frame or packet section contains a nested section.

Fix trac issue http://trac.ffmpeg.org/ticket/8680.

Signed-off-by: Marton Balint <cus@passwd.hu>
2022-06-09 00:10:17 +02:00
Michael Niedermayer
ade36d61de avcodec/texturedspenc: Fix indexing in color distribution determination
Fixes CID1396405

MSE and PSNR is slightly improved, and some noticable corruptions disappear as
well.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Marton Balint <cus@passwd.hu>
2022-06-09 00:02:02 +02:00
Matthieu Bouron
6dd6c58d89 libavformat/tls_libtls: handle TLS_WANT_{POLLIN, POLLOUT} in read/write functions
According to the tls documentation: tls_read() and tls_write() can
return TLS_WANT_POLLIN and TLS_WANT_POLLOUT which indicates that the
same operation must be repeated immediately.

This commit prevents the libtls backend from failing when libtls returns
TLS_WANT_POLLIN or TLS_WANT_POLLOUT with the following error:

    [tls @ 0x7f6e20005a00] (null)

Signed-off-by: Marton Balint <cus@passwd.hu>
2022-06-08 23:09:47 +02:00
softworkz
830f49cb9d avcodec/dvdsubdec, dvbsubdec: remove bitmap dumping in DEBUG builds
It's been a regular annoyance and often undesired.
There will be a subtitle filter which allows to dump individual
subtitle bitmaps.

Signed-off-by: softworkz <softworkz@hotmail.com>
Signed-off-by: Marton Balint <cus@passwd.hu>
2022-06-08 22:27:50 +02:00
softworkz
22ab2a375d libavutil/tests/md5: Remove 'volatile workaround' to avoid warnings
Those are always showing up on Patchwork when FATE tests are failing,
covering some possibly more useful information.

The volatile keyword was used as a workaround for an eight year old
clang version.

Signed-off-by: softworkz <softworkz@hotmail.com>
Signed-off-by: Marton Balint <cus@passwd.hu>
2022-06-08 22:24:31 +02:00
Shiyou Yin
b6c856b6e4 MAINTAINERS: add myself as maintainer for LoongArch.
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2022-06-08 18:29:30 +02:00
Anton Khirnov
38df63f967 lavf/matroskadec: stop mapping text/plain attachments to AV_CODEC_ID_TEXT
There is no reason to think that an attachment will contain text
subtitles. Furthermore, attachments are exported in extradata, so the
AV_CODEC_ID_TEXT decoder would not do anything useful with them anyway.
2022-06-08 09:27:54 +02:00
Ivan Baykalov
58880a8ea8 libavformat/isom: Add more language mappings
mov_mdhd_language_map table doesn't contain ISO 639 codes for some of
the languages. I added a few which have no contradictory mappings

Fixes ticket #9743

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2022-06-07 11:12:05 +02:00
James Almer
93505a9095 tools/target_dec_fuzzer: add a custom get_buffer2() implementation
Unlike avcodec_default_get_buffer2(), this version does not allocate more than
what the lavu image helper functions consider should be allocated for a given
frame.
Since the get_buffer2() documentation does not require any kind of buffer
padding for any of the planes, this should help detect bugs in our DR1 decoders
if they read beyond the end of the buffer, simulating what some library users
might experience when they use their own custom get_buffer2() implementations.

Signed-off-by: James Almer <jamrial@gmail.com>
2022-06-06 09:40:44 -03:00
Vardan Margaryan
73302aa193 swscale/x86/yuv_2_rgb: fix access to memory past the frame data in yuv to rgb conversion
Y, U, V data is loaded at the end of the current iteration for the next
iteration.
It results in memory access past the frame data on the last iteration
(that data is never used after the loading).

So load data at the start of the iteration, so that only useful data is
loaded.

Signed-off-by: Vardan Margaryan <v.t.margaryan@gmail.com>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2022-06-06 09:51:17 +02:00
Thilo Borgmann
72106d6cc3 lavfi/blockdetect: Reindent after last commit 2022-06-06 09:09:34 +02:00
Thilo Borgmann
b7cea55730 lavfi/blockdetect: Fix possible div by 0
Found-by Covererity, CID 1504568, 1504569
2022-06-06 09:09:25 +02:00
Yue Heng
11912f65ef libavcodec/qsvenc: Add min/max QP control options for I/P/B frame
To do more accurate QP control, add min/max QP control on I/P/B frame
separately to qsv encoder. qmax and qmin still work but newly-added
options have higher priority.

Signed-off-by: Yue Heng <yue.heng@intel.com>
Signed-off-by: Wenbin Chen <wenbin.chen@intel.com>
2022-06-06 13:56:10 +08:00
Linjie Fu
e838169181 doc/vaapi_encode: add documentations for max_frame_size
Add docs for max_frame_size option.

Signed-off-by: Linjie Fu <linjie.fu@intel.com>
Signed-off-by: Fei Wang <fei.w.wang@intel.com>
2022-06-06 13:56:10 +08:00
Linjie Fu
99446c74cf lavc/vaapi_encode: add support for maxframesize
Add support for max frame size:
    - max_frame_size (bytes) to indicate the max allowed size for frame.

Control each encoded frame size into target limitation size by adjusting
whole frame's average QP value. The driver will use multi passes to
adjust average QP setp by step to achieve the target, and the result
may not strictly guaranteed. Frame size may exceed target alone with
using the maximum average QP value. The failure always happens on the
intra(especially the first intra frame of a new GOP) frames or set
max_frame_size with a very small number.

example cmdline:
    ffmpeg -hwaccel vaapi -vaapi_device /dev/dri/renderD128 -f rawvideo \
        -v verbose -s:v 352x288 -i ./input.yuv -vf format=nv12,hwupload \
        -c:v h264_vaapi -profile:v main -g 30 -rc_mode VBR -b:v 500k   \
        -bf 3 -max_frame_size 40000 -vframes 100 -y ./max_frame_size.h264

Max frame size was enabled since VA-API version (0, 33, 0), but query
is available since (1, 5, 0). It will be passed as a parameter in picParam
and should be set for each frame.

Signed-off-by: Linjie Fu <linjie.fu@intel.com>
Signed-off-by: Fei Wang <fei.w.wang@intel.com>
2022-06-06 13:56:10 +08:00
James Almer
5929ea6d4b avutil/avframe: fix channel layout checks in av_frame_copy()
Normally, both the source and dest frame would have only the old API fields
set, only the new API fields set, or both set. But in some cases, like when
calling av_frame_ref() using a non reference counted source frame where only
the old channel layout API fields were populated, the result would be the dst
frame having both the new and old fields populated.

This commit takes this into account and fixes the checks by calling
av_channel_layout_compare() only if the source frame has the new API fields
set, and doing sanity checks for the source frame old API fields if the new
ones are not set.

Signed-off-by: James Almer <jamrial@gmail.com>
2022-06-05 09:09:07 -03:00
Paul B Mahol
e93006c67b fate: add test for QOI format 2022-06-05 13:06:54 +02:00
Paul B Mahol
973fab5653 avcodec: add QOI decoder and demuxer and parser and encoder and muxer 2022-06-05 13:06:54 +02:00
rcombs
c6364b711b lavfi/vf_tonemap_opencl: fix build
This was broken in d42b410e05.
2022-06-01 20:09:17 -05:00
rcombs
3e580351bc lavfi/vf_scale_vulkan: fix build
This was broken in d42b410e05.
2022-06-01 20:07:47 -05:00
rcombs
bb6d9a0f32 Makefile: avoid cp-ing over existing executable files
On macOS, code-signing information for executables (including those signed
automatically by the linker) is cached by the system on a per-inode basis.
The cp(1) tool will truncate and overwrite an existing file if present,
so we need to delete it first to avoid strange crashes.

See https://developer.apple.com/documentation/security/updating_mac_software
2022-06-01 19:38:50 -05:00
rcombs
c534d9f72a lavc/h264_ps: always include the stop bit in [s|p]ps->data
The VideoToolbox hwaccel needs the entire NAL (including the stop bit),
but ff_h2645_packet_split may remove it. Detect this case by looking for
bit counts divisible by 8 and insert a stop-bit-only 0x80 byte.

Signed-off-by: rcombs <rcombs@rcombs.me>
2022-06-01 19:38:50 -05:00
rcombs
792a9f2406 lavc/videotoolboxdec: insert emu-prevention bytes for HEVC as well
Fixes decoding of files with sync-fooling sequences in their PSs.

Signed-off-by: rcombs <rcombs@rcombs.me>
2022-06-01 19:38:50 -05:00
rcombs
a465e2c39e lavc/videotoolboxdec: fix writing too many 1 bits for the reserved fields
Signed-off-by: rcombs <rcombs@rcombs.me>
2022-06-01 19:38:50 -05:00
rcombs
928b22edfe lavc/videotoolboxdec: fix generating HEVC general_profile_compatibility_flags
We store this as an array of bools, not a bitfield.

Signed-off-by: rcombs <rcombs@rcombs.me>
2022-06-01 19:38:50 -05:00
rcombs
686b64e155 lavc/videotoolboxdec: fix escaping sequential zero sequences
This ensure that e.g. 0000000000 becomes 00000300 000300,
rather than 00000300 0000.

Signed-off-by: rcombs <rcombs@rcombs.me>
2022-06-01 19:38:50 -05:00
rcombs
dfbc921f9f lavc/videotoolboxdec: warn on nonzero status in the callback
Signed-off-by: rcombs <rcombs@rcombs.me>
2022-06-01 19:38:50 -05:00
Thilo Borgmann
e9107d16f3 lavfi/blockdetect: Remove nop init() function 2022-06-01 21:31:20 +02:00
Ronald S. Bultje
6e13c30a8f vp9: don't overread by 4 pixels in ff_vp9_avg4_mmxext().
If the block is at the end of the allocated buffer and there is no
padding, this will over-read, which may cause crashes. Reported by
Firefox.
2022-06-01 14:31:32 -04:00
Leo Izen
d42b410e05 avutil/csp: create public API for colorspace structs
This commit moves some of the functionality from avfilter/colorspace
into avutil/csp and exposes it as a public API so it can be used by
libavcodec and/or libavformat. It also converts those structs from
double values to AVRational to make regression testing easier and
more consistent.

Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2022-06-01 13:52:38 -04:00
Andreas Rheinhardt
77b529fbd2 fate/dca: Fix test requirements
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-06-01 14:56:50 +02:00
Andreas Rheinhardt
bdfe9d5418 tests/Makefile: Add PCM function
For use with the "pcm" command.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-06-01 14:56:50 +02:00
Vignesh Venkatasubramanian
f55c91497d avcodec/libaomenc: Expose the allintra usage mode
libaom added an usage=allintra mode for doing better with still
images. Expose that in the ffmpeg's wrapper. This is especially
useful for encoding still AVIF images.

Signed-off-by: Vignesh Venkatasubramanian <vigneshv@google.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2022-05-31 16:16:29 -03:00
Semen Belozerov
3a7e9caf92 avcodec/vp9: ipred_hd_16x16_16 avx2 implementation
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2022-05-31 08:07:57 -04:00
Andreas Rheinhardt
bdba8ecce2 fate/wavpack: Test APE cuesheet tags
The cue_sheet.wv sample contains a cue sheet as APE tags,
yet this is not really covered by fate-wavpack-cuesheet
because the metadata does not affect the output of said test.
So add a proper test for this.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-05-31 12:45:41 +02:00
Andreas Rheinhardt
2351212227 fate/wavpack: Avoid temp files
Use the md5 protocol instead of creating a file just to calculate
its MD5 checksum. This is possible because there are no output seeks
involved in any of these tests.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-05-31 12:45:41 +02:00
Andreas Rheinhardt
3b770682dd fate/wavpack: Fix test requirements
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-05-31 12:45:41 +02:00
Andreas Rheinhardt
6d037537c1 avcodec/wavpack: Remove redundant av_channel_layout_uninit()
av_channel_layout_copy() will uninit the dst channel layout
before copying the new one.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-05-31 12:45:41 +02:00
Andreas Rheinhardt
38ef9cf39e fate/vpx: Remove unused define parameters
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-05-31 12:45:41 +02:00
Andreas Rheinhardt
120aa6173c fate/opus: Restore fate-opus-(celt|hybrid|silk)
Also fix the test requirements.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-05-31 12:45:41 +02:00