1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-01-24 13:56:33 +02:00

114702 Commits

Author SHA1 Message Date
Marton Balint
89ea8af0b3 avformat/mp3dec: simplify inner frame size check in mp3_read_header
We are protecting the checked buffer with ffio_ensure_seekback(), so if the
inner check fails with a seek error, that likely means the end of file was
reached when checking for the next frame. This could also be the result of a
wrongly guessed (larger than normal) frame size, so let's continue the loop
instead of breaking out early. It will end sooner or later anyway.

Signed-off-by: Marton Balint <cus@passwd.hu>
(cherry picked from commit b75e604fe5cd7da9ca713f20d1ade18d50319aff)
2024-05-21 08:42:59 +02:00
Marton Balint
07ee3648b7 avformat/mp3dec: only call ffio_ensure_seekback once
Otherwise the subsequent ffio_ensure_seekback calls destroy the buffer of the
earlier. The worst case ~66kB seekback is so small it is easier to request it
entirely.

Fixes ticket #10837, a regression since
0d17f5228f4d3854066ec1001f69c7d1714b0df9.

Signed-off-by: Marton Balint <cus@passwd.hu>
(cherry picked from commit b0053172199b54a806a4147cda8567a2f1823bc0)
2024-05-21 08:41:49 +02:00
James Almer
060d2ce8ae avcodec/cbs_h266: read vps_ptl_max_tid before using it
Reviewed-by: Nuo Mi <nuomi2021@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
(cherry picked from commit b113050d96d9d36ac2e7f10b3af8b9c61684c33f)
2024-05-20 14:31:03 -03:00
Nuo Mi
00ccb7be29 avcodec/cbs_h266: fix sh_collocated_from_l0_flag and sh_collocated_ref_idx infer
we have to infer sh_collocated_from_l0_flag and sh_collocated_ref_idx from picture head if pps_rpl_info_in_ph_flag is true

(cherry picked from commit 191fbd7ddc1a66fb48b6d4b4f2afd698245ab6ed)
2024-05-20 14:31:03 -03:00
James Almer
a8b8b1042f avformat/vvc: fix parsing some early VPS bitstream values
vps_default_ptl_dpb_hrd_max_tid_flag needs to always be set, and
vps_direct_ref_layer_flag needs to be read even when
vps_max_tid_ref_present_flag is false.

Signed-off-by: James Almer <jamrial@gmail.com>
(cherry picked from commit a48203d51aa4836150f9379448f6b2a1d5ca9d36)
2024-05-20 14:27:42 -03:00
James Almer
5f23eecfba avformat/vvc: fix writing general_constraint_info bytes
The existing implementation was completely broken.

Signed-off-by: James Almer <jamrial@gmail.com>
(cherry picked from commit 415dfa89e29686786085c207fdebcf2c97883a33)
2024-05-20 14:27:42 -03:00
Brad Smith
8b0fe91754 avutil/ppc/cpu: Also use the machdep.altivec sysctl on NetBSD
Use the machdep.altivec sysctl on NetBSD for AltiVec detection
as is done with OpenBSD.

(cherry picked from commit 115c96b9bd53e775f425f23d5b73fa0a9dedbd08)
Signed-off-by: Brad Smith <brad@comstyle.com>
2024-05-18 19:34:14 -04:00
Brad Smith
6ab65792ab lavd/v4l2: Use proper field type for second parameter of ioctl() with BSD's
The proper type was used until 73251678c83cbe24d08264da693411b166239bc7.

This covers all of the OS's that currently have V4L2 support, permutations
of Linux glibc/musl, Android bionic, FreeBSD, NetBSD, OpenBSD, Solaris.

Copied from FreeBSD ports patch.

Signed-off-by: Brad Smith <brad@comstyle.com>
Signed-off-by: Marton Balint <cus@passwd.hu>
(cherry picked from commit 9e674b31606c805dd31b4bb754364a72a5877238)
Signed-off-by: Brad Smith <brad@comstyle.com>
2024-05-18 19:33:46 -04:00
Mark Thompson
e7d2238ad7 vulkan_av1: Fix force_integer_mv value
(cherry picked from commit 7b482815a07bce0d5428ec282f5fca6337163691)
2024-05-06 21:33:30 +01:00
Mark Thompson
a4bc1dd928 vaapi_av1: Fix force_integer_mv value
(cherry picked from commit b73e6af3370f082d9385f418a03ed7baf69ada60)
2024-05-06 21:33:25 +01:00
Mark Thompson
c3665ee60f av1dec: Add force_integer_mv derived field for decoder use
This is not the same as the syntax element value in the frame header
because the specification parsing tables override the value on intra
frames.

(cherry picked from commit 6f56e0e7e516fef419c6b4361612c8a9bc178a2b)
2024-05-06 21:33:03 +01:00
James Almer
a51c06b42c avutil/iamf: fix offsets for mix_gain options
Signed-off-by: James Almer <jamrial@gmail.com>
(cherry picked from commit d6e877bbcde2a0d1422d7b5c7339bb03891d19fc)
2024-05-04 21:33:32 -03:00
Michael Niedermayer
da8b2f9704 avformat/iamfdec: check nb_streams in header read
Fixes: Assertion pkt->stream_index < (unsigned)s->nb_streams && "Invalid stream index.\n" failed at libavformat/demux.c:572
Fixes: 67890/clusterfuzz-testcase-minimized-ffmpeg_dem_IAMF_fuzzer-5166340789829632.fuzz

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 9f54c13bc4650c59fe2ffb04f5b85145f196fbb7)
2024-05-01 15:46:44 -03:00
James Almer
1e6382a6b7 avformat/mov: free the infe allocated item data on failure
Fixes: memleak
Fixes: 68212/clusterfuzz-testcase-minimized-ffmpeg_dem_MOV_fuzzer-4963488540721152

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Tested-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: James Almer <jamrial@gmail.com>
(cherry picked from commit e09164940e4ff0b0ee9228f9d27385211160c6da)
2024-05-01 15:45:53 -03:00
James Almer
5683aa6318 avformat/iamf_writer: reject duplicated stream ids in a stream group
Signed-off-by: James Almer <jamrial@gmail.com>
(cherry picked from commit 6b6a0fc53df592183c69e518967841272ab4e862)
2024-05-01 15:45:53 -03:00
James Almer
fb8f0ea7b3 avformat/mov: don't read key_size bytes twice in the keys atom
We only support mdta as type, yet we were not skipping other types,
but rather reading key_size worth of bytes twice per entry.

Signed-off-by: James Almer <jamrial@gmail.com>
(cherry picked from commit 5a06d3810e41134ee9c2941cc0b371da62b539db)
2024-04-29 09:46:18 -03:00
James Almer
0085da21b4 avformat/mov: take into account the first eight bytes in the keys atom
Signed-off-by: James Almer <jamrial@gmail.com>
(cherry picked from commit 3d12ba77d9a4660b2e71889d1c2f99e8f3ade98b)
2024-04-29 09:46:18 -03:00
James Almer
64a048d4cc avformat/mov: fix the check for the heif item parsing loop
Fixes: Null pointer dereference
Fixes: 67861/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-5352628142800896

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: James Almer <jamrial@gmail.com>
(cherry picked from commit 31327c2d075a413749c1461c06382993b9bba90e)
2024-04-29 09:33:08 -03:00
James Almer
96d941b30e avutil/iamf: fix mix_gain_class name
Signed-off-by: James Almer <jamrial@gmail.com>
(cherry picked from commit b9af58184fd3bf6438924ce7e827ed198e517f7f)
2024-04-24 19:07:11 -03:00
Mark Thompson
9963b9e3c9 av1dec: Fix RefFrameSignBias calculation
(cherry picked from commit ba6b08c75b6e8394c5c53bde22623a393a2d1c47)
2024-04-24 17:36:01 +02:00
James Almer
506fbe681c avcodec/codec_par: always clear extradata_size in avcodec_parameters_to_context()
Missed in d383ae43c266b160348db04f2fd17ccf30286784.

Signed-off-by: James Almer <jamrial@gmail.com>
(cherry picked from commit c4e3d6cdb066425a5f5a2e05def9470a47a6082c)
2024-04-24 00:17:16 -03:00
Zhao Zhili
13e93ffbfd avcodec/mediacodecenc: Fix return empty packet when bsf is used
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
(cherry picked from commit a5a3788f562066a830a925d71cdbe8650e457e3b)
2024-04-23 16:10:28 +08:00
Andreas Rheinhardt
2d3ee7c069 avcodec/hevcdec: Fix precedence, bogus film grain warning
Reviewed-by: Niklas Haas <ffmpeg@haasn.xyz>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
(cherry picked from commit bba996d6cdac15367f265e245987477d0f7b1899)
2024-04-22 23:43:03 +03:00
Niklas Haas
30002d58fa avcodec/hevcdec: fix segfault on invalid film grain metadata
Invalid input files may contain film grain metadata which survives
ff_h274_film_grain_params_supported() but does not pass
av_film_grain_params_select(), leading to a SIGSEGV on hevc_frame_end().

Fix this by duplicating the av_film_grain_params_select() check at frame
init time.

An alternative solution here would be to defer the incompatibility check
to hevc_frame_end(), but this has the downside of allocating a film
grain buffer even when we already know we can't apply film grain.

Fixes: https://trac.ffmpeg.org/ticket/10951
(cherry picked from commit 459648761f5412acdc3317d5bac982ceaa257584)
2024-04-22 23:43:03 +03:00
Frank Plowman
cbd98447bc lavc/vvc: Skip enhancement layer NAL units
The native VVC decoder does not yet support quality/spatial/multiview
scalability.  Bitstreams requiring this feature could cause crashes.
Patch fixes this by skipping NAL units which are not in the base layer,
warning the user while doing so.

Signed-off-by: Frank Plowman <post@frankplowman.com>
Signed-off-by: James Almer <jamrial@gmail.com>
(cherry picked from commit bb9e4ff355684b0325d1632b89baab96cc24dc51)
2024-04-18 22:29:31 -03:00
James Almer
ed55219edd avformat/mov: ignore old infe box versions
Some files with no image items have them, and were working prior to the recent
HEIF parsing overhaul.
Ignore such boxes instead, to recover the old behavior.

Fixes a regression since d9fed9df2a9e70c9375d3b2591db35c09303d369.

Tested-by: Wu Jianhua <toqsxw@outlook.com>
Signed-off-by: James Almer <jamrial@gmail.com>
(cherry picked from commit 5b9db32ccc9426dc2aa37f21eee4c9efd1baf75b)
2024-04-18 13:03:11 -03:00
Lynne
8dfafe5366 vulkan_av1: add workaround for NVIDIA drivers tested on broken CTS
The first release of the CTS for AV1 decoding had incorrect
offsets for the OrderHints values.
The CTS will be fixed, and eventually, the drivers will be
updated to the proper spec-conforming behaviour, but we still
need to add a workaround as this will take months.

Only NVIDIA use these values at all, so limit the workaround
to only NVIDIA. Also, other vendors don't tend to provide accurate
CTS information.

(cherry picked from commit db09f1a5d811a3ca8adc89c58e29932efd0c255e)
2024-04-16 18:14:32 +02:00
Mark Thompson
48721a415a lavc/vulkan_av1: Use av1dec reference order hint information
(cherry picked from commit 3cca8dfbd88dfbf9c20f2e8c8da47881b4596567)
2024-04-16 18:14:32 +02:00
Mark Thompson
0d851a82dd lavc/av1: Record reference ordering information for each frame
This is needed by Vulkan.  Constructing this can't be delegated to CBS
because packets might contain multiple frames (when non-shown frames are
present) but we need separate snapshots immediately before each frame
for the decoder.

(cherry picked from commit 22ced1edc6fc4100072e122d549fe379aff76954)
2024-04-16 18:14:32 +02:00
James Almer
d38bf5e08e doc/encoders: add missing libxvid option
Signed-off-by: James Almer <jamrial@gmail.com>
(cherry picked from commit 6f13f5dd59675d76844fc798d90028ab442c2521)
2024-04-05 17:21:54 -03:00
James Almer
6c701b5f6c doc/encoders: remove non-existent flag
Signed-off-by: James Almer <jamrial@gmail.com>
(cherry picked from commit 16ba7bdd764fc562a3fcdf86f65d8467537d9278)
2024-04-05 17:14:02 -03:00
Andreas Rheinhardt
e2a1a4f581 fate/ffmpeg: Avoid dependency on samples
Creating vsynth_lena.yuv needs the FATE suite,
yet several tests in ffmpeg.mak without a dependency
on samples used it as input file. Fix this by using
vsynth1.yuv (which does not have such a dependency)
instead.
Also use vsynth1.yuv in fate-shortest to avoid
the samples dependency in this test, too.

Fixes ticket #10947.

Reviewed-by: Anton Khirnov <anton@khirnov.net>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
(cherry picked from commit 7b7b7819bd21cc92ac07f6696b0e7f26fa8f9834)
2024-04-05 17:51:27 +02:00
Andreas Rheinhardt
265de29acb avcodec/wavpack: Remove always-false check
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
(cherry picked from commit d307aca184a15be78236889c226f2699f40a1948)
2024-04-05 17:42:01 +02:00
Andreas Rheinhardt
607fca80b7 avcodec/wavpack: Fix leak and segfault on reallocation error
av_realloc_f() frees the buffer it is given on allocation
failure. But in this case, the buffer is an array of
ownership pointers, causing leaks on error. Furthermore,
the count of pointers is unchanged on error and the codec's
close function uses it to free said ownership pointers,
causing a NPD.
This is a regression since 46412a8935e4632b2460988bfce4152c7dccce22.

Fix this by switching to av_realloc_array().

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
(cherry picked from commit 2f59648aed8ba538e2ff3cd7edcb85f4501faa25)
2024-04-05 01:49:15 +02:00
Andreas Rheinhardt
82aa188281 avcodec/lossless_videoencdsp: Don't presume alignment in diff_bytes
The alignment of all the parameters in diff_bytes can be
anything the despite the documentation claiming otherwise.
8ecd38312210d48ec9e50d78fc223d60e71a30ed was based around
said documentation and is therefore insufficient to fix
e.g. the misaligned loads that happen in the huffyuvbgra
and huffyuvbgr24 vsynth FATE-tests.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
(cherry picked from commit a4800643bba40cf8461406aa078da93e42e6ea6c)
2024-04-05 01:49:05 +02:00
Andreas Rheinhardt
0e3a46720a avcodec/ppc/h264dsp: Fix left shifts of negative numbers
PPC equivalent of c756b3fca240df75ffa28e75f2eb34834c10294d.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
(cherry picked from commit e54696bcaa0819674e2f9bc7c9a4c87383675091)
2024-04-05 01:48:56 +02:00
Michael Niedermayer
083443d67c
RELEASE_NOTES: Based on the version from 5.1
Name suggested by 7 people on ML

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
n7.0
2024-04-05 00:31:10 +02:00
Michael Niedermayer
4f0e9457d6
Update for 7.0
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-04-05 00:26:26 +02:00
Leo Izen
9a4c7b937f avcodec, avformat/ffjni: fix duplicate JNI symbols
Use SHLIBOBJS and STLIBOBJS in the Makefiles for avcodec and avformat,
and add a stub ffjni.c to libavformat, which allows the symbols to be
duplicated for shared builds but not static builds.

Signed-off-by: Leo Izen <leo.izen@gmail.com>
Signed-off-by: Matthieu Bouron <matthieu.bouron@gmail.com>
2024-04-04 21:54:22 +02:00
Michael Niedermayer
abaa747ee5
avformat/pcm: Use 64bit in bitrate computation
Fixes: signed integer overflow: 65792 * 65312 cannot be represented in type 'int'
Fixes: 67819/clusterfuzz-testcase-minimized-ffmpeg_dem_WADY_fuzzer-5236100912185344

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit bf3b74142e4402912e26b5e58a0b63f87ec3cd21)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-04-04 21:12:16 +02:00
Michael Niedermayer
3736130e5b
avformat/mxfdec: Check index_edit_rate
Fixes: Assertion b >=0 failed at libavutil/mathematics.c:62
Fixes: 67811/clusterfuzz-testcase-minimized-ffmpeg_dem_MXF_fuzzer-5108429687422976

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit ed49391961999f028e0bc55767d0eef6eeb15e49)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-04-04 21:12:16 +02:00
Michael Niedermayer
e0dd533ad6
swscale/utils: Fix xInc overflow
Fixes: signed integer overflow: 2 * 1073741824 cannot be represented in type 'int'
Fixes: 67802/clusterfuzz-testcase-minimized-ffmpeg_SWS_fuzzer-6249515855183872

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 1a9eda65d027e0167f7363e0514f71311ac5d8d1)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-04-04 21:12:16 +02:00
Michael Niedermayer
97751fda3e
avformat/iamf_parse: Check sound_system
Fixes: index 13 out of bounds for type 'const struct IAMFSoundSystemMap [13]'
Fixes: 67796/clusterfuzz-testcase-minimized-ffmpeg_dem_IAMF_fuzzer-4554553191104512

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 4593cf7ab3f0ff2884880b625f1873f0eaf7a439)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-04-04 21:12:15 +02:00
Michael Niedermayer
1ef084f910
avcodec/wavarc: fix signed integer overflow in block type 6/19
Fixes: signed integer overflow: -2088796289 + -91276551 cannot be represented in type 'int'
Fixes: 67772/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_WAVARC_fuzzer-6533568953122816

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 28c7094b25b689185155a6833caf2747b94774a4)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-04-04 21:12:15 +02:00
Michael Niedermayer
839e8baa20
doc/developer: (security) researchers should be credited
Reviewed-by: Tomas Härdin <git@haerdin.se>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 5a5422196d0283918a1aa996a81bd51522f34fda)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-04-04 21:12:15 +02:00
Michael Niedermayer
d918d9afe0
avformat/isom: Uninit layout in ff_mp4_read_dec_config_descr()
Fixes: memleak
Fixes: 67442/clusterfuzz-testcase-minimized-ffmpeg_dem_CAF_fuzzer-5068813261406208

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: James Almer <jamrial@gmail.com>
(cherry picked from commit d157725cf726adc29385d264eaf79ae430b1f3e5)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-04-04 21:12:14 +02:00
Marth64
4866aaf7c5 Changelog: fix typos for 7.0 section
Signed-off-by: James Almer <jamrial@gmail.com>
(cherry picked from commit e3335e9e9ebfff4acea97fd715b2824ec1957b96)
2024-04-04 12:44:32 -03:00
Jean-Baptiste Kempf
3b6732bcb3 changelog: update for 7.0
Signed-off-by: James Almer <jamrial@gmail.com>
(cherry picked from commit 486a2b964ba4e496ecd821e189d495ad06585abe)
2024-04-04 10:58:09 -03:00
Andreas Rheinhardt
aeff85620a configure: Fix iamfdec dependencies
Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
(cherry picked from commit 9c4558b5963bbc47a03bb8f99d0a99d03c5fd734)
2024-04-03 23:19:39 +02:00
Andreas Rheinhardt
fd8fb39af9 configure: Add missing libdav1d/av1 decoders->dovi_rpu dependency
Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
(cherry picked from commit 924402f783d7d056eefa5c065504fbae2731235b)
2024-04-03 20:13:10 +02:00