Commit graph

118431 commits

Author SHA1 Message Date
James Almer
37155d68ec avcodec/opus/parser: set duration when complete frames are fed
Fixes a regression since 873a34c129.

Signed-off-by: James Almer <jamrial@gmail.com>
2025-01-03 18:22:02 -03:00
James Almer
4bf784c0e5 avformat/dump: print only the actual streams in a tile grid group
The amount of tiles does not necessarely need to match the amount of streams.

Fixes ticket #11389.

Signed-off-by: James Almer <jamrial@gmail.com>
2025-01-03 10:34:03 -03:00
James Almer
c187dd88de avcodec/opus/parser: reindent after the previous commit
Signed-off-by: James Almer <jamrial@gmail.com>
2025-01-03 10:34:01 -03:00
James Almer
873a34c129 avcodec/opus/parser: set sample rate
Ensures it's set on scenarios where a parser is requested but no decoder is
present.

Signed-off-by: James Almer <jamrial@gmail.com>
2025-01-03 10:33:31 -03:00
James Almer
fb59995b88 avformat/flvdec: set Opus sample rate
Fixes parsing Opus streams when no opus decoder is present.

Signed-off-by: James Almer <jamrial@gmail.com>
2025-01-03 10:31:20 -03:00
James Almer
547408ce1d avformat/iamfdec: swap back and side streams if both are present
Layouts with both pairs (7.1, 7.1.2, etc) in IAMF that follow the definition in
ITU-R BS.2051-3 for Systems I and J also follow its ordering. This means side
comes before back, which is the inverse of how it's defined in AVChannel.

To workaround this without having to use custom order channel layouts, swap the
stream ids in the input IAMF structure, so packets for one are mapped to the
other.

Signed-off-by: James Almer <jamrial@gmail.com>
2025-01-03 10:27:13 -03:00
James Almer
c089c158d6 avformat/iamf: document the expandable channel layouts
Signed-off-by: James Almer <jamrial@gmail.com>
2025-01-03 10:27:13 -03:00
James Almer
8f6a1a06a6 avformat/iamf: use the correct layouts for Sound Systems B and C
They have the side channels, not back, as defined in ITU-R - BS.2051-3

Signed-off-by: James Almer <jamrial@gmail.com>
2025-01-03 10:27:13 -03:00
James Almer
3fa70c03e4 avformat/iamf_writer: be more verbose when reporting an input layout is invalid
Signed-off-by: James Almer <jamrial@gmail.com>
2025-01-03 10:27:13 -03:00
James Almer
aba9fafee7 avutil/channel_layout: fix definition of 5.1.4 layout
It's meant to have the side channels, as defined in Sound System D from
ITU-R - BS.2051-3

Signed-off-by: James Almer <jamrial@gmail.com>
2025-01-03 10:27:12 -03:00
James Almer
da9dcaba69 avutil/channel_layout: add a 5.1.2 layout using side channels
And rename the existing 5.1.2 to explicitly state it contains back channels.

Signed-off-by: James Almer <jamrial@gmail.com>
2025-01-03 10:27:12 -03:00
551041e384
vulkan_decode: remove informative queries
We queried the decoder whether it was able to decode sucessfully, but
since we operated asynchronously, we weren't able to do anything with
this information but let the user know decoding failed for the previous
frame(s).

Since we parse the slice headers ourselves and we're reasonably sure we
can decode before actually starting to decode, this was rarely triggered
on corrupt data, and hardware's understanding of whether there was an error
or not is vague.

There's also a semantic problem with our use of the queries - if there's
a seek, we flush, but what happens to the queries is vague according to
the spec. Most hardware dealt fine, since queries are nothing more than
GPU memory with integers stored. But with Intel, they seem to be more of
a register to which a driver must keep track of, leading to issues if there's
been a reset (seek) and we query the previous submission before the seek.

Just get rid of them. The query code is still used in encoding.

This fixes seeking with HEVC and AV1 on Intel.
2025-01-03 14:53:41 +09:00
e7b474783c
ffv1enc_vulkan: allow setting the number of slices via -slices
Falls back to the exact same code the software encoder uses.
2025-01-03 14:53:41 +09:00
d9b773c22f
hwcontext_vulkan: add VK_EXT_layer_settings to optional instance extensions
The issue is that some compilers complain if a struct or array
is empty.

This extension does nothing by default, and can be useful, so just add it
to keep the array non-empty.
2025-01-03 14:53:37 +09:00
Manuel Lauss
b22ce90d42 avcodec/sanm: SMUSH codec48 decoder
Adds a decoder for the SMUSH codec48 video encoding, as is used by
the LucasArts game "Mysteries of the Sith".

Signed-off-by: Manuel Lauss <manuel.lauss@gmail.com>
Signed-off-by: Marton Balint <cus@passwd.hu>
2025-01-03 00:00:10 +01:00
James Almer
dd5696c197 avfilter/buffersrc: make channel_layout a CHLAYOUT type AVOption
The string type is a remnant of the old channel layout API implementation.

Reviewed-by: Nicolas George <george@nsup.org>
Signed-off-by: James Almer <jamrial@gmail.com>
2025-01-02 12:11:08 -03:00
Joe Schiffler
0457aaf0d3 configure: Include quotes around pkg_version
In some MSYS environments it can happen that the 3 argument syntax
for pkg-config library specifications fails because somehow the
expansion of pkg_version ends up with a redirection we guess.

To avoid failures like in the referenced build[2], we quote it
so the whole module including operators will be expanded into
a single shell word and the single argument syntax for specifying
the library for pkg-config will be used.

The single argument syntax seems to be supported by the original
pkg-config from the beginning more than 20 years[3].

In the pkgconf implementation single argument syntax was supported
pretty much from the beginning as well. The multiple argument syntax
we used until this change, was not supported until a change[4] more
than 10 years ago.

References
----------

1. Build passing with quotes:
   https://github.com/JoeSchiff/pyav-ffmpeg/actions/runs/12358403929
2. Build failing without quotes:
   https://github.com/JoeSchiff/pyav-ffmpeg/actions/runs/12360472377
3. Earliest commit of the current pkg-config Git repo already mentions the single argument syntax:
   2ac96cbcc7 (124c0becfe68b1ef671f49ed2b9d24779ace126f_0_162)
4. pkgconf gets support for 3 argument syntax (pkgconf --exists liba = 1.2.3):
   793de6a06c

Commit-message-by: Alexander Strasser <eclipse7@gmx.net>
Signed-off-by: Joe Schiffler <joeschiffler3@gmail.com>
Signed-off-by: Alexander Strasser <eclipse7@gmx.net>
2025-01-02 09:23:00 +01:00
James Almer
041a6c3614 avfilter/buffersink: don't leak the reallocated channel layouts array
And ensure the last element is the zeroed terminator.

Fixes ticket #11392.

Signed-off-by: James Almer <jamrial@gmail.com>
2025-01-01 19:42:11 -03:00
f7900a5609
avformat/demux: Check packet duration
Fixes: signed integer overflow: 24320 + 9223372036854775573 cannot be represented in type 'long'
Fixes: 71001/clusterfuzz-testcase-minimized-ffmpeg_dem_MATROSKA_fuzzer-5644785744936960

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-01-01 21:33:46 +01:00
b9b4c9ebf0
avcodec/get_buffer: Use av_buffer_mallocz() for audio same as its done for video
Fixes: Use of uninintialized value
Fixes: 70993/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_AAC_LATM_fuzzer-6378949754552320
Fixes: 71104/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_AAC_FIXED_fuzzer-5001538727116800

For the AAC/USAC/SBR code which reads uninitialized memory, it would be good, if it did not
a fix for that is welcome!

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-01-01 21:33:46 +01:00
3f0b95bb17
avformat/jpegxl_anim_dec: clear buffer padding
Fixes: use of uninitialized value
Fixes: 70992/clusterfuzz-testcase-minimized-ffmpeg_dem_IMAGE2_fuzzer-5735819170611200

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-01-01 21:33:46 +01:00
9578c135d0
avformat/rmdec: check that buf if completely filled
Fixes: use of uninitialized value
Fixes: 70988/clusterfuzz-testcase-minimized-ffmpeg_dem_IVR_fuzzer-5298245077630976

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-01-01 21:33:45 +01:00
9de721de70
avcodec/cfhdenc: Clear dwt_tmp
This occurs on a 32x32 input

Fixes: use of uninitialized value
Fixes: 70897/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_CFHD_fuzzer-5960860961406976

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-01-01 21:33:45 +01:00
7eeeda703b
avcodec/hapdec: Clear tex buffer
The code following makes no attempt to initialize all of the buffer

Fixes: use of uninitialized value
Fixes: 70980/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_HAP_fuzzer-5329909059223552

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-01-01 20:31:08 +01:00
4c62cbcae2
avformat/mxfdec: Check that key was read sucessfull
Fixes: use of uninitialized value
Fixes: 70932/clusterfuzz-testcase-minimized-ffmpeg_dem_MXF_fuzzer-4870202133643264

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-01-01 20:31:07 +01:00
d3aa99a4f4
configure: update copyright year
On 01/01/2025 19:05, Peter Ross wrote:
> FFmpeg turns 25 this year.
2025-01-01 20:15:25 +09:00
eab65379bf
avformat/rpl: Fix check for negative values
Fixes: signed integer overflow: 10 * -1923267925333400000 cannot be represented in type 'int64_t' (aka 'long')
Fixes: 378891963/clusterfuzz-testcase-minimized-fuzzer_loadfile_direct-5714338935013376
Found-by: ossfuzz
Reported-by: Kacper Michajlow <kasper93@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-12-31 19:15:19 +01:00
James Almer
1446e37d3d avfilter/buffersrc: check for valid sample rate
A sample rate <= 0 is invalid.

Fixes an assert in ffmpeg_enc.c that assumed a valid sample rate would be set.
Fixes ticket #11385.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-12-31 11:54:12 -03:00
James Almer
658a645e18 tests/checkasm/sw_rgb: remove bogus value truncation in check_yuv2packed1()
Fixes out of array accesses.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-12-31 11:53:18 -03:00
James Almer
15b16d58df avcodec/ac3dec: set preferred_stereo_downmix using the relevant coded value
Signed-off-by: James Almer <jamrial@gmail.com>
2024-12-31 11:30:09 -03:00
James Almer
9d16c64134 avcodec/ac3dec_float: fix range for dmix_mode
Value 3 is used to signal "Dolby Pro Logic II" by some encoders.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-12-31 11:30:09 -03:00
James Almer
376bb8481a avcodec/ac3dec_float: define the downmix related options as exported and read-only
They are not user settable options.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-12-31 11:30:09 -03:00
James Almer
61519a6e98 avcodec/ac3dec: set ltrt_center_mix and ltrt_surround_mix using the relevant coded values
Signed-off-by: James Almer <jamrial@gmail.com>
2024-12-31 11:30:09 -03:00
bb85423142
avformat/mlvdec: Check avio_read()
Fixes: use-of-uninitialized-value
Fixes: 383170476/clusterfuzz-testcase-minimized-ffmpeg_dem_MLV_fuzzer-4696002884337664

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>
2024-12-31 04:56:26 +01:00
53db351654
avformat/mxfdec: Check llen addition for overflow
Fixes: signed integer overflow: 9223372036854775807 + 1 cannot be represented in type 'long'
Fixes: 377971441/clusterfuzz-testcase-minimized-ffmpeg_dem_MXF_fuzzer-4966030696316928

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-12-31 04:56:26 +01:00
ae81beb351
avcodec/aac/aacdec: Free channel layout
Fixes: 371445194/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_AAC_LATM_fuzzer-5981081124274176
Fixes: memleak

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-12-31 04:56:25 +01:00
James Almer
d1d9b0813a avcodec/libdav1d: clear the buffered Dav1dData on decoding failure
Should ensure avcodec_send_packet() doesn't return EAGAIN in scenarios where it's not
meant to (e.g., ffmpeg_dec.c where avcodec_receive_frame() is called in a loop to drain
all produced frames before trying to submit more packets).

Fixes ticket #11377.

Reviewed-by: Ronald S. Bultje <rsbultje@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2024-12-30 20:38:00 -03:00
5f38c82536 avformat: bump version for enhanced flv 2024-12-27 20:24:23 +01:00
770f0a2434 avformat/flvdec: propagate av_packet_add_side_data failure 2024-12-27 20:24:23 +01:00
741e49c56f avformat/flvenc: prevent writing legacy codecs into extended video tracks 2024-12-27 20:24:23 +01:00
64043d7b18 fate/flvenc: add test for multitrack flv 2024-12-27 20:24:23 +01:00
e3836d1d05 avformat/rtmpproto: reserve enough space for statusmsg 2024-12-27 20:24:22 +01:00
e2a8ece352 avformat/flvdec: support all multi-track modes 2024-12-27 20:24:22 +01:00
da32990e83 avformat/flvdec: stop shadowing local variables 2024-12-27 20:24:22 +01:00
f8dc4d94fd avformat/rtmpproto: add more enhanced rtmp codecs 2024-12-27 20:24:22 +01:00
25faaa311a avformat/flvdec: add support for reading multi track audio 2024-12-27 20:24:22 +01:00
bbf1f3cf6f avformat/flvenc: add support for writing multi track audio 2024-12-27 20:24:22 +01:00
67b5fb4b59 avformat/flvdec: parse enhanced rtmp multichannel info 2024-12-27 20:24:22 +01:00
3db28fb067 avformat/flvenc: write enhanced rtmp multichannel info for audio with more than two channels 2024-12-27 20:24:22 +01:00
63613fe915 avformat/flvenc: refactor fourcc writing 2024-12-27 20:24:22 +01:00