1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-08-04 22:03:09 +02:00
Commit Graph

120490 Commits

Author SHA1 Message Date
02bb64849a tests/fate/audio: G.728 test case 2025-08-04 08:01:24 +00:00
00be24c2d7 doc/bitstream_filters: correct variable use in examples
Time has to be expressed as timestamp x time base

Signed-off-by: Gyan Doshi <ffmpeg@gyani.pro>
2025-08-04 12:21:19 +05:30
c78195788d forgejo/CODEOWNERS: fix alphabetical order
Oops.
2025-08-04 15:24:27 +09:00
193938e640 tests/fate/subtitles: add test for LRC with ms -> ms conversion
Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
2025-08-04 03:59:42 +00:00
670c1b9266 avformat/lrcenc: add precision option
Allows to output LRC with more precision than standard centiseconds.
Time base is determined by number of requested digits.

Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
2025-08-04 03:59:42 +00:00
a29aeee37e tests/fate/subtitles: add test for LRC with milliseconds timestamp
Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
2025-08-04 03:59:42 +00:00
bc3cc0a6af avformat/lrcdec: support arbitrary precision timestamp
Apparently files with milliseconds exist in the wild. And since it cost
nothing to support arbitrary number of digits, extend format to support
that.

Depending on number of digits, the time base of fractional part is
changing. Most LRCs use 2 digits and centiseconds base, but subs with 3
digits and miliseconds exist too.

Set internal time base to AV_TIME_BASE, which in parcitice allows to
hold microseconds with 6 digits. Totally artificial, but who knows maybe
someone wants that.

Fixes: #11677

Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
2025-08-04 03:59:42 +00:00
e916f55c91 forgejo/CODEOWNERS: add missing handle to new entries
Signed-off-by: James Almer <jamrial@gmail.com>
2025-08-04 00:10:43 -03:00
cae8c4587a forgejo/CODEOWNERS: add myself for iamf
Signed-off-by: James Almer <jamrial@gmail.com>
2025-08-04 00:02:56 -03:00
ceaa8ed96b forgejo/CODEOWNERS: add a CODEOWNERS file to automatically add reviewers
This helps with finding reviews.
2025-08-04 11:49:01 +09:00
c447fab16c forgejo/workflows: run fate with assert level 2
Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
2025-08-04 02:27:23 +00:00
55d234b433 libavcodec/tests/motion: Add check for avcodec_alloc_context3()
Add check for the return value of avcodec_alloc_context3() to avoid potential NULL pointer dereference.

Fixes: 5d48e4eafa ("Merge commit 'a6a750c7ef240b72ce01e9653343a0ddf247d196'")
Signed-off-by: Jiasheng Jiang <jiashengjiangcool@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-08-04 01:29:45 +02:00
9ca58424de examples: Add av_freep to avoid potential memory leak
Add av_freep() to free avio_ctx_buffer if avio_alloc_context fails
to avoid potential memory leak.

Fixes: 5fc4dea39c ("examples: add avio_reading.c example")
Signed-off-by: Jiasheng Jiang <jiashengjiangcool@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-08-04 01:29:44 +02:00
ab040e2565 avcodec/tests/avpacket: Add av_packet_free() to avoid memory leak
Add av_packet_free() to free avpkt_clone and avpkt in the error paths to avoid potential memory leak.

Fixes: da3c69a5a9 ("Added test for libavcodec/avpacket.c")
Signed-off-by: Jiasheng Jiang <jiashengjiangcool@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-08-04 01:29:44 +02:00
008679ec16 avcodec/tests/avpacket: Add av_free() to avoid memory leak
Add av_free() to free extra_data if av_packet_add_side_data() fails.

Fixes: da3c69a5a9 ("Added test for libavcodec/avpacket.c")
Signed-off-by: Jiasheng Jiang <jiashengjiangcool@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-08-04 01:29:44 +02:00
3f58c9df14 avfilter/x86/vf_bwdif: use the correct preprocessor check
Signed-off-by: James Almer <jamrial@gmail.com>
2025-08-03 19:26:18 -03:00
7f00e24d70 vf_bwdif: add AVX512 implementation
I also tried replacing some of the instructions by more elaborate ones
using masks, but I found no performance gain significant enough to be worth
maintaining two code paths, so this implementation merely replaces the AVX2
implementation by drop-in AVX512 equivalents.

bwdif8_c:                                             6362.2 ( 1.00x)
bwdif8_sse2:                                          1004.9 ( 6.33x)
bwdif8_ssse3:                                          946.0 ( 6.73x)
bwdif8_avx2:                                           477.9 (13.31x)
bwdif8_avx512:                                         273.3 (23.28x)

bwdif10_c:                                            6341.5 ( 1.00x)
bwdif10_sse2:                                          872.4 ( 7.27x)
bwdif10_ssse3:                                         803.4 ( 7.89x)
bwdif10_avx2:                                          416.7 (15.22x)
bwdif10_avx512:                                        224.3 (28.27x)

Realtime test at 3840x2160 yuv420p:

avx2:   frame=20000 fps=3370 q=-0.0 Lsize=N/A time=00:06:40.00 bitrate=N/A speed=67.4x elapsed=0:00:05.93
avx512: frame=20000 fps=5077 q=-0.0 Lsize=N/A time=00:06:40.00 bitrate=N/A speed= 102x elapsed=0:00:03.93

The use of this function is gated behind avx512icl so that it doesn't
downclock on Skylake.
2025-08-03 22:13:51 +00:00
586a1cd088 avformat/webvttdec,webvttenc: update documentation
The previous links lead to a 404 page as that page doesn't exist anymore.

Signed-off-by: Leon Grutters <gruttersleonbot2@gmail.com>
2025-08-03 21:24:38 +00:00
cc6ad703b4 forgejo/lint_commit_msg: add script for commit message linting
Based on mpv's script, under LGPL. https://github.com/mpv-player/mpv

Co-authored-by: Timo Rothenpieler <timo@rothenpieler.org>
Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
2025-08-03 20:45:12 +00:00
d5f7a428b1 avcodec/dvbsubenc: fix 256 color rle decoding
The end of 8-bit/pixel_code_string() is signalled with two zero bytes, so we
should read those from the buffer instead of one. We keep supporting though our
own buggy encoder which only put one zero byte there.

Signed-off-by: Marton Balint <cus@passwd.hu>
2025-08-03 21:33:29 +02:00
aeb6ea51f5 avcodec/dvbsubdec: convert dvbsub_read_8bit_string to bytestream reader
No change in functionality.

Signed-off-by: Marton Balint <cus@passwd.hu>
2025-08-03 21:33:29 +02:00
74f470c05c avcodec/dvbsubenc: fix end of 8-bit/pixel-code-string
Fixes ticket #11606.

Signed-off-by: Marton Balint <cus@passwd.hu>
2025-08-03 21:33:29 +02:00
3e859d933e avformat/mov: item names can be NULL in infe boxes
Fixes assertions after 11a5333980.

Signed-off-by: James Almer <jamrial@gmail.com>
2025-08-03 16:28:19 -03:00
5c95e8e3a6 avcodec/srtenc: don't produce SRT files with mixed line endings
Initially, avcodec/srtenc.c was outputting CRLF [1]. Later, a real SRT
muxer was added [2], which outputs LF. The original srtenc.c was
converted to use the muxer [3], changing its output to LF, except for
newline characters within subtitle text.

Fix this to avoid producing SRT files with mixed line endings.

[1] 8e43b6fed9
[2] 9e63c30daa
[3] 55180b3299

Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
2025-08-03 17:27:35 +00:00
5bd7003e81 avformat/mov: move AVC-Intra extradata generation to earlier in the stsd parsing process
This will ensure it will be stored in the stream's private context, so it can
be fetched and replaced as required.

Fixes a regression since eefa6de7d5.
Fixes avc-intra-panasonic-AG-HPX301E.mov

Signed-off-by: James Almer <jamrial@gmail.com>
2025-08-03 16:06:43 +00:00
999e3e9bf8 avformat/mov: don't set stsc_count for item streams before the array is allocated
Signed-off-by: James Almer <jamrial@gmail.com>
2025-08-03 13:00:03 -03:00
89187a84d3 avformat/mov: free streams earlier on error when parsing infe boxes
Fixes clusterfuzz-testcase-minimized-fuzzer_loadfile-5365661771825152.

Signed-off-by: James Almer <jamrial@gmail.com>
2025-08-03 13:00:03 -03:00
11a5333980 avformat/mov: free AVBPrint on error when parsing infe boxes
Should fix memleaks.

Signed-off-by: James Almer <jamrial@gmail.com>
2025-08-03 13:00:03 -03:00
44864dbbb9 avcodec/vqavideo; Check bytestream2_get_buffer() reading next_codebook_buffer
Fixes: use of uninintilaized memory
Fixes: 423673969/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_VQA_fuzzer-6235973619351552

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-08-03 13:19:25 +00:00
7e9e7cb3b6 avcodec/iff: Clear ham_buf
Fixes: use of uninitialized memory
Fixes: 423673969/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_IFF_ILBM_fuzzer-6651797156724736

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-08-03 13:19:25 +00:00
715df4b1ff avcodec/imc: Clear padding of buf16
Fixes: use of uninitialized memory
Fixes: 423673969/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_IAC_fuzzer-6685890556788736

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-08-03 13:19:25 +00:00
ea3851bebf avcodec/cri: Check bytestream2_get_buffer() for end
Fixes: use of uninintialized memory
Fixes: 423673969/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_CRI_fuzzer-5910856640823296

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-08-03 13:19:25 +00:00
d9bf3c141b avcodec/cri: Factor read_len out
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-08-03 13:19:25 +00:00
610d368d9b avcodec/lzf: Check for input space
Fixes: use of uninitialized memory
Fixes: 423673969/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_NOTCHLC_fuzzer-5597015691296768

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-08-03 13:19:25 +00:00
1687daa93c avcodec/fits: Clear naxis
Fixes: Use of uninitialized memory
Fixes: 423673969/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_FITS_DEC_fuzzer-5602250833854464

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-08-03 13:19:25 +00:00
16d663d371 forgejo/workflows: add pre-commit based linting 2025-08-03 13:48:47 +02:00
262d41c804 all: fix typos found by codespell 2025-08-03 13:48:47 +02:00
8d439b2483 all: fix whitespace/new-line issues 2025-08-03 13:48:47 +02:00
ce0a655f85 avformat/dashdec: Allocate space for appended "/"
Fixes: writing 1 byte over the end of the array
Fixes: BIGSLEEP-433502298/test.xml

Found-by: Google Big Sleep

A prettier solution is welcome!
A testcase exists only for the baseurl case

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-08-03 00:31:12 +02:00
ff52147f59 avutil/hwcontext_qsv: fix format specifier for HRESULT
Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
2025-08-02 22:25:28 +00:00
1a9924d794 avcodec/amfenc: remove unused variables
Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
2025-08-02 22:25:28 +00:00
a27c329487 avcodec/ffv1: align function declaration with definition
Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
2025-08-02 22:25:28 +00:00
518d9f0dd4 avcodec/g728dec: align static arrays to 32-byte boundary
fixes crash observed on x86_64-apple-darwin23.6.0 / clang-1500.3.9.4

Signed-off-by: Peter Ross <pross@xvid.org>
2025-08-02 21:36:36 +00:00
aca41d3d93 swscale/output: Fix all bilinear integer overflows
Ticket11686 hinted at one of these overflows
this fixes them all

Issue in line 1325/1326 found by HAORAN FANG <xfanghaoran@gmail.com>

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-08-02 16:26:33 +00:00
c44d237d80 swscale/output: Fix integer overflow with lum/chr/alpha filter
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-08-02 16:26:33 +00:00
f82748d5e0 lavc/vvc: Mark SPS used if multiple CLVSSs use it
Consider the following sequence of NALUs (with some PPSs etc. omitted
for brevity):
1. SPS (ID=0, content=A)
2. IDR (SPS=0)
3. IDR (SPS=0)
4. SPS (ID=0, content=B)
5. TRAIL (SPS=0)

When decode_sps is called for NALU 3., ps->sps_id_used is cleared as
IDRs are one way of forming a CLVSS.  Then, old_sps is non-NULL
containing the result of calling decode_sps for NALU 2.  We haven't
received any SPSs between NALUs 2. and 3., therefore old_sps and rsps
are identical and the function returns.  The issue is that, at this
point, ps->sps_id_used is still zero despite the SPS being used for IDR
3.  This results in the check for conflicting SPSs not working properly
when decode_sps is called for NALU 5., allowing prediction between
pictures with different SPSs and probably all sorts of other
shenanigans.

Patch addresses the problem outlined above by also setting
ps->sps_id_used in the early return case.
2025-08-02 15:04:39 +00:00
2e19e74a29 hwcontext_vulkan: transfer exclusive images to correct queue family in drm->vulkan mapping 2025-08-02 11:02:59 +03:00
bf79148cbb avcodec/proresenc_anatoliy: Remove support for grayscale flag
This results in the encoder producing empty scans for chroma planes,
which is illegal according to the ProRes SMPTE document.
2025-08-02 06:11:39 +00:00
a49108fd29 avcodec/proresdec: Remove grayscale hack
This was introduced in commit 9c43703, to support a codec "extension"
in the prores_aw encoder.
This removes the chroma fill loop, and instead performs the inverse
transform on null coefficients, which achieves the same result and
fixes an off-by-one in the chroma values produced.

Updated test to reflect this change.
2025-08-02 06:11:39 +00:00
2b522f537f avformat/mov: add extra sanity checks before setting the primary extradata
Signed-off-by: James Almer <jamrial@gmail.com>
2025-08-01 19:35:43 +00:00