Commit Graph

117812 Commits

Author SHA1 Message Date
James Almer e7bdaadce6 avformat/mov: check that items are allocated before accessing them
Fixes NULL pointer dereferences introduced in 2e338152a2

Fixes: clusterfuzz-testcase-fuzzer_loadfile-4753810267897856
Fixes: clusterfuzz-testcase-minimized-fuzzer_loadfile-6042587212873728
Fixes: clusterfuzz-testcase-minimized-fuzzer_loadfile-6536211629408256

Reported-by: kasper93
Signed-off-by: James Almer <jamrial@gmail.com>
2024-11-12 12:23:32 -03:00
Marton Balint fe18ed3f2a avfilter/f_loop: fix aloop activate logic
The logic did not follow the documented behaviour and that caused skipping of
some audio in the loop and in the leftover buffer.

Example command line which should produce a smooth sine wave for the whole
duration of the output:

ffmpeg -f lavfi -i "sine=r=48000:f=480:d=4" -af "aloop=loop=4:start=48000:size=48000" out.wav

Fixes ticket #11283.

Signed-off-by: Marton Balint <cus@passwd.hu>
2024-11-11 21:56:34 +01:00
Marton Balint b33a594160 avfilter/f_loop: fix length of aloop leftover buffer
If the audio loop stops inside an audio frame, the leftover buffer contains the
end of the frame, which is not looped. The length supposed to be the part which
was not written to the loop buffer, so we need to drain exactly that number of
bytes from the leftover buffer.

Signed-off-by: Marton Balint <cus@passwd.hu>
2024-11-11 21:56:34 +01:00
James Almer 97c5cc3a5c Revert "avcodec/h2645_sei: fix parsing AOM grain provider_oriented_code"
This reverts commit 24141a7140.
It was a change made by looking at an old spec version.
2024-11-11 17:11:15 -03:00
James Almer e33b162c7d avcodec/h2645_sei: use the RefStruct API for film_grain_characteristics
And ensure the buffer is synced between threads.
Based on a patch by Dale Curtis <dalecurtis@chromium.org>

Signed-off-by: James Almer <jamrial@gmail.com>
2024-11-11 16:10:15 -03:00
James Almer fd4a2c9b02 avcodec/aom_film_grain: allocate film grain metadata dynamically
This removes the ABI breaking use of sizeof(AVFilmGrainParams), and achieves the
same size reduction to decoder structs as 08b1bffa49.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-11-11 16:10:15 -03:00
James Almer 24141a7140 avcodec/h2645_sei: fix parsing AOM grain provider_oriented_code
The value is 16 bits big endian, not a single byte.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-11-11 16:10:10 -03:00
James Almer 91b6ba653e Revert "avcodec/h2645: allocate film grain metadata dynamically"
AVFilmGrainAFGS1Params, the offending struct, is using sizeof(AVFilmGrainParams)
when it should not. This change also forgot to make the necessary changes to the
frame threading sync code.
Both of these will be fixed by the following commit.

H274FilmGrainDatabase will be handled later.

This reverts commit 08b1bffa49.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-11-11 15:26:21 -03:00
James Almer 9ec042c1aa avcodec/x86/vvc: add prototypes for OF functions
And wrap the implemtation in preprocessor checks.
Should fix ticket #11282.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-11-11 19:34:11 +08:00
Frank Plowman 1e5f24d1a6 lavc/vvc: Remove floating point logic
This was the only floating point logic in the native VVC decoder.

Signed-off-by: Frank Plowman <post@frankplowman.com>
2024-11-11 19:31:00 +08:00
Zhao Zhili 994368be8f x86/vvc: Fix build error for arch x86_32
There were static functions which built for x86_32, but the simd
functions they reference only available for x86_64.
2024-11-11 19:30:09 +08:00
Nuo Mi c49001e338 avcodec/cbs_h266: Fix regression in DVB clip introduced by 93281630a7
This commit introduced a regression to VVC_HDR_UHDTV1_OpenGOP_3840x2160_50fps_HLG10_mosaic.ts.

Root Cause:
The AV_CEIL_RSHIFT(a, b) macro uses bit tricks that work only when -a is a negative value.
However, due to integer promotion rules, this behavior does not extend to the unsigned int type.

See "6.3.1.1 Boolean, characters, and integers" in the "ISO/IEC 9899" for details.

Reported-by: Frank Plowman <post@frankplowman.com>
2024-11-11 19:30:09 +08:00
Michael Niedermayer 96d45c3b21
avformat/vividas: Check avio_read() for failure
Fixes: use of uninitialized value (untested)
Fixes: 42537627/clusterfuzz-testcase-minimized-fuzzer_loadfile_direct-5505802505355264

Found-by: ossfuzz
Reported-by: Kacper Michajlow
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-11-11 01:28:06 +01:00
Michael Niedermayer e30d957a9b
avformat/ilbc: Check avio_read() for failure
Fixes: use of uninitialized value
Fixes: 42537627/clusterfuzz-testcase-minimized-fuzzer_protocol_memory-6656646223298560-cut

Found-by: ossfuzz
Reported-by: Kacper Michajlow
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-11-11 01:28:06 +01:00
Michael Niedermayer 898f6582eb
avformat/nistspheredec: Clear buffer
Fixes: use-of-uninitialized-value
Fixes: 42537627/clusterfuzz-testcase-minimized-fuzzer_protocol_memory-6515855798632448-cut

Found-by: ossfuzz
Reported-by: Kacper Michajlow
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-11-11 01:28:05 +01:00
Michael Niedermayer bf8e43083f
avformat/mccdec: Initialize and check rate.den
Fixes: Assertion c > 0 failed at libavutil/mathematics.c:61
Fixes: use-of-uninitialized-value
Fixes: 42537627/clusterfuzz-testcase-minimized-fuzzer_protocol_memory-5939605805793280

Found-by: ossfuzz
Reported-by: Kacper Michajlow
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-11-11 01:28:05 +01:00
Michael Niedermayer beca13a42e
avformat/rpl: check channels
Fixes: 42537199/clusterfuzz-testcase-minimized-fuzzer_loadfile_direct-5447162658357248
Fixes: runtime error: signed integer overflow: -3330498059201358222 * 4 cannot be represented in type 'int64_t' (aka 'long')

Found-by: ossfuzz
Reported-by: Kacper Michajlow
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-11-11 01:28:05 +01:00
compn b16102ab1c doc/infra: add more information and accounts 2024-11-11 10:26:35 +10:00
James Almer 2b1bf3e228 fate/pixfmt: reintroduce scale filter dependency for some tests
Removed by mistake in 271aea60a4.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-11-10 20:22:22 -03:00
James Almer 92b849df13 avformat/mov: reindent after previous commit
Signed-off-by: James Almer <jamrial@gmail.com>
2024-11-10 12:04:53 -03:00
James Almer 2e338152a2 avformat/mov: use an array of pointers for heif_item
Pointers to specific entries in the array are stored in other structs, so
in the scenario where heif_item was reallocated when parsing an iloc box after
and iinf one, the pointers may end up referencing freed memory.

Fixes use-after-free with such samples.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-11-10 12:04:53 -03:00
vectronic 7f51cf75c6 avformat/hls: improve comment
Signed-off-by: vectronic <hello.vectronic@gmail.com>
2024-11-10 11:20:08 +08:00
vectronic 380a518c43 avformat/mov: if pos has been reset, clear fragments and indexes and search for next root
fixes https://trac.ffmpeg.org/ticket/7359

Signed-off-by: vectronic <hello.vectronic@gmail.com>
2024-11-10 11:20:01 +08:00
Peter Ross 2f34b159b4 avcodec/eatgq: decode motion vector macroblocks
Signed-off-by: Peter Ross <pross@xvid.org>
2024-11-10 12:31:19 +11:00
James Almer 10c02deccb avfilter/vf_zscale: extend the configuration log message with color space info
And print it in DEBUG level, not TRACE, as it's useful information.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-11-09 19:33:57 -03:00
James Almer 5c8268ac56 avfilter/vf_zscale: remove unecessary argument from realign_frame
Possible since the previous commit.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-11-09 19:33:56 -03:00
James Almer c8e5c684b3 avfilter/vf_zscale: align the frame buffers
Signed-off-by: James Almer <jamrial@gmail.com>
2024-11-09 19:33:56 -03:00
Pavel Koshevoy 00cf3df03f lavfi/vf_zscale: fix call to av_pix_fmt_count_planes
realign_frame called av_pix_fmt_count_planes with incorrect parameter.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-11-09 19:33:56 -03:00
Pavel Koshevoy 7b302f4db7 lavfi/vf_zscale: fix tmp buffer ptr alignment for zimg_filter_graph_process
Signed-off-by: James Almer <jamrial@gmail.com>
2024-11-09 19:33:56 -03:00
James Almer f15fc27db5 avfilter/framepool: align the frame buffers
And not just the linesizes. Use the extra align bytes allocated for this purpose.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-11-09 19:33:56 -03:00
Marth64 6d5a0998b6 doc/bitstream_filters: elaborate on h264_redundant_pps
Signed-off-by: Marth64 <marth64@proxyid.net>
2024-11-09 10:02:34 -06:00
Anton Khirnov 13129f1af4 lavc: deprecate the omx encoders
They have not been relevant for a long time, and support for this API is
also being dropped from other projects.
2024-11-09 02:46:17 +01:00
Anton Khirnov 9e68b26765 Document stream specifier syntax change from 46cbe4ab5c
Fixes #11248.
2024-11-09 02:45:58 +01:00
Anton Khirnov 3e9b0f7c01 lavfi/vf_libplacebo: eliminate LibplaceboInput.link
Setting it was broken in 8160178dfc, since
links are not yet set up during init. It is also redundant, as the
struct also stores the input index.

Reported-By: llyyr <llyyr.public@gmail.com>
2024-11-09 02:45:58 +01:00
Peter Ross 2bbbf36fe2 avcodec/rv60: set populate_ipred src parameter to const 2024-11-09 08:50:59 +11:00
Peter Ross 006718c475 avcodec/rv60: align calc_sel_qp with reference decoder
Fixes ticket #11290.
2024-11-09 08:50:59 +11:00
Peter Ross c8c6319ce1 avcodec/rv60: prevent decode_cu_r deadlock
Fixes ticket #11289 (deadlock).
2024-11-09 08:50:59 +11:00
Peter Ross 4d4d171afb avcodec/rv60: prevent decode_cu_r segfault
Fixes ticket #11289 (crash).
2024-11-09 08:50:59 +11:00
Peter Ross 923f45430c avcodec/rv60: check init_get_bits8 return value
Fixes CID 1634471
2024-11-09 08:50:58 +11:00
Peter Ross d51a920556 avcodec/rv60: negative qp guard
Fixes CID 1634472
2024-11-09 08:50:58 +11:00
Osamu Watanabe 82467b635e
avcodec/jpeg2000: Improve FF_DWT97_INT to pass ISO/IEC 15444-4 conformance tests
Fixes https://trac.ffmpeg.org/ticket/10123

Signed-off-by: Pierre-Anthony Lemieux <pal@palemieux.com>
2024-11-08 08:30:07 -08:00
James Almer 3330b733d3 fate/pixfmt: disable dithering in the scale filter
Should fix fate failures across different systems.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-11-08 09:19:06 -03:00
Tomas Härdin 733d891bdf lavf/mxfenc: Use nb_components, not av_pix_fmt_count_planes()
Also check that pix_desc != NULL, thanks James Almer

This fixes https://trac.ffmpeg.org/ticket/11267
2024-11-08 10:52:04 +01:00
compn f4ba5b083c doc/git-howto: remove outdated line about gitolite 2024-11-08 15:59:13 +10:00
Marth64 11c703be31 avcodec/mpeg12dec: set FF_CODEC_PROPERTY_CLOSED_CAPTIONS in mpeg_set_cc_format()
When Closed Captions are discovered, this method is always invoked.
Therefore, use it to set the property instead of repeating the statement.

Signed-off-by: Marth64 <marth64@proxyid.net>
2024-11-07 21:27:04 -06:00
James Almer 2eb9c35010 x86/swscale: disable AVX2 yuv2nv12cX functions if accurate_rnd is requested
Signed-off-by: James Almer <jamrial@gmail.com>
2024-11-07 11:16:42 -03:00
Araz Iusubov f63f164125 avcodec/amfenc: GOP size check
Fix for the error with an invalid GOP size parameter.
2024-11-07 15:11:10 +01:00
James Almer 4047b887fc swscale/swscale_unscaled: add more unscaled planar RGB to planar RGB coverage
Signed-off-by: James Almer <jamrial@gmail.com>
2024-11-06 17:45:47 -03:00
James Almer c5ebd56500 swscale/swscale_unscaled: add unscaled XV{36,48}LE <-> XV{36,48}BE
Signed-off-by: James Almer <jamrial@gmail.com>
2024-11-06 17:45:47 -03:00
James Almer 271aea60a4 fate/pixfmts: extend the high bit depth test
Also test 8bit formats, and try bitdepth conversion paths.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-11-06 17:44:25 -03:00