Commit graph

118431 commits

Author SHA1 Message Date
7187eadf8c
ffv1dec: use dedicated pix_fmt field and call ff_get_format
Adding support for hwaccels means that avctx->pix_fmt will indicate
hardware formats.
2025-01-22 00:09:37 +09:00
5c59e6ce19
vulkan: enable using .elems field for buffer content definitions
This avoids needing to snprintf when the buffer only contains an array of a struct,
while letting the validation layers detect errors more reliably.
2025-01-22 00:09:32 +09:00
Lingyi Kong
504df09c34 avcodec/h264: fix stride calculation in slice_table for multi-slice field video deblocking
fix for https://trac.ffmpeg.org/ticket/11360
A new fate test case is added to validate the fix, the smaple file is located at https://trac.ffmpeg.org/attachment/ticket/11360/slice2_field_aurora4.264.

Signed-off-by: Lingyi Kong <konglingyi@visionular.com>
2025-01-20 08:50:01 +00:00
James Almer
bb033e6910 avcodec/ac3dec: only export matrix encoding and downmix info side data when necessary
Don't export a matrix encoding side data when there's none signaled.
And if downmixing was handled by the decoder itself, then the downmix info does
not apply to the frame.

Signed-off-by: James Almer <jamrial@gmail.com>
2025-01-19 15:14:18 -03:00
James Almer
4563cf95ca avcodec/ac3dec: don't override existing downmix coefficient with default ones
With this, if the eac3 dependent frame doesn't have coded downmix values when
parsed by ff_eac3_parse_header(), it will inherit the coded ones from the core
ac3 frame instead of ignoring them.

Signed-off-by: James Almer <jamrial@gmail.com>
2025-01-19 15:14:18 -03:00
Zhao Zhili
ea381285e7 avcodec/vvc: Add support for output_corrupt/showall flags 2025-01-19 13:30:13 +08:00
James Almer
a328b219ed fate/tests/flvenc: add missing ffprobe dependency to fate-enhanced-flv-multitrack
Reviewed-by: Timo Rothenpieler <timo@rothenpieler.org>
Signed-off-by: James Almer <jamrial@gmail.com>
2025-01-18 18:20:52 -03:00
a3e506455e avformat/flvdec: correctly skip command frame for enhanced flv 2025-01-18 21:57:02 +01:00
ced9fddec0 avformat/flvdec: implement support for parsing ModEx data 2025-01-18 21:57:02 +01:00
4c96d6bf75
avformat/dashdec: Check whitelist
Fixes: CVE-2023-6602, V. DASH Playlist SSRF

Found-by: Harvey Phillips of Amazon Element55 (element55)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-01-17 23:33:27 +01:00
c6c54943d1
avutil/avstring: dont mess with NULL pointers in av_match_list()
Fixes: applying zero offset to null pointer

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-01-17 23:33:26 +01:00
Stefan Pöschel
2ac2ebcd76
doc/protocols: fix/improve RTP documentation
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-01-17 23:33:26 +01:00
Manuel Lauss
9a794897c3
avcodec/sanm: simplify codec37 subcodec 3/4 path
A flag in the codec header determines whether opcodes 0xfd/0xfe
are to be treated as special or not.  The current code has 2
implementations of the same decoding scheme, with one treating
the 2 opcodes as special, the other not.
Collapse them into a single implementation and treat these opcode
according to the flag.

Signed-off-by: Manuel Lauss <manuel.lauss@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-01-17 23:33:25 +01:00
Manuel Lauss
fff7737b3d
avcodec/sanm: implement codec37 subcodec1
RLE-compressed stream of motion vector indices and a special opcode
to fill a block with data from the source stream.

It is used in the LucasArts "Full Throttle" blink*.san animations.

Signed-off-by: Manuel Lauss <manuel.lauss@gmail.com>
Fixes: Ticket5753
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-01-17 23:33:25 +01:00
James Almer
c08d300481 avformat/avformat: also clear FFFormatContext packet queue when closing a muxer
packet_buffer is used in mux.c, and if a muxing process fails at a point where
packets remained in said queue, they will leak.

Fixes ticket #11419

Signed-off-by: James Almer <jamrial@gmail.com>
2025-01-17 10:10:51 -03:00
Zhao Zhili
4f3c9f2f03 avcodec/mediacodecenc: Support config qp range
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2025-01-15 15:05:50 +08:00
Zhao Zhili
ff00037368 avcodec/cuviddec: Fix missing HW_CONFIG_METHOD_HW_FRAMES_CTX flag
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2025-01-15 15:05:45 +08:00
Zhao Zhili
d157e1f16b avcodec/bit_depth_template: Remove empty macro INIT_CLIP
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2025-01-15 15:05:37 +08:00
66e9888bf4
avfilter/vf_v360: Fix NULL pointer use
Fixes: applying zero offset to null pointer
partly Fixes: verysmall.flv

Found-by: Elias Myllymäki <elias.myllymaki04p@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-01-15 01:27:46 +01:00
827c073154
avcodec/mpegvideo_enc: Check FLV1 resolution limits
Found-by: Elias Myllymäki <elias.myllymaki04p@gmail.com>
Reviewed-by: Alexander Strasser <eclipse7@gmx.net>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-01-15 01:27:46 +01:00
402824e9e9
avcodec/ffv1enc: Fix handling of 32bit unsigned symbols
This may be needed for floats

Sponsored-by: Sovereign Tech Fund
Reviewed-by: Alexander Strasser <eclipse7@gmx.net>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-01-15 01:27:45 +01:00
afbc3a1b23
avformat/mov: perform sanity checks for heif before index building
Fixes: undefined NULL pointer use
Fixes: clusterfuzz-testcase-minimized-audio_decoder_fuzzer-6363211175493632

This performs equivalent sanity checks as are done in mov_read_trak()
before mov_build_index()

Reported-by: Dale Curtis <dalecurtis@chromium.org>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-01-15 01:27:45 +01:00
16b3d3e3eb
avformat/mov: Factorize sanity check out
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-01-15 01:27:45 +01:00
yuanhecai
858acd8d02
loongarch: fixes fate-checkasm-sw_rgb failure
The reason for the failure is that the function yuv2rgb_1_c_template was modified
in 095f8038fa. The corresponding functional test
was added in c601bb8df5. The code on loongarch was
not updated in a timely manner, resulting in the error.

Signed-off-by: yuanhecai <yuanhecai@loongson.cn>
Reviewed-by: yinshiyou-hf@loongson.cn
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-01-15 01:27:36 +01:00
James Almer
fd1772b747 avformat/mov: fix potential unsigned underflow in loop condition
if sc->tts_count is 0, this condition will wrap around to UINT_MAX and the
code will try to dereference a NULL pointer.

Fixes ticket #11417

Signed-off-by: James Almer <jamrial@gmail.com>
2025-01-13 19:27:00 -03:00
Nuo Mi
8eb1d76e14 lavc/vvc/refs: export keyframe and picture type in output frames
fixes https://trac.ffmpeg.org/ticket/11406

Co-authored-by: Ruben Gonzalez <rgonzalez@fluendo.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2025-01-13 18:05:06 -03:00
James Almer
d5873be583 avformat/iamf_parse: add missing av_free() call on failure path
Fixes ticket #11416

Signed-off-by: James Almer <jamrial@gmail.com>
2025-01-13 17:28:22 -03:00
Jun Zhao
b88fc4e098 lavc/ac3dsp: fix R-V HAVE_RVV scope issue
fix R-V HAVE_RVV scope issue

Reviewed-by: Rémi Denis-Courmont <remi@remlab.net>
Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
2025-01-13 23:58:54 +08:00
Jun Zhao
8ded602eda ffbuild/bin2c: misc fix
close input file if open output fail/read errors.

Signed-off-by: Alexander Strasser <eclipse7@gmx.net>
Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
2025-01-13 23:58:36 +08:00
851a84650e
hwcontext_vulkan: check if semaphores are exportable before enabling exporting
lavapipe recently added support for external_semaphore_fd, but only for syncfiles,
not for opaque file descriptors.

The code is written to allow using syncfiles later on.

Ref: https://gitlab.freedesktop.org/mesa/mesa/-/issues/12422
2025-01-13 10:44:30 +09:00
Andreas Rheinhardt
5a72266d49 tests/checkasm/sw_rgb: Fix leaks
Also use loop-scope for variables where appropriate.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-01-12 15:41:40 +01:00
Andreas Rheinhardt
e540381f91 avfilter/vf_xpsnr: Avoid array only one of whose elements is used
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-01-12 15:41:40 +01:00
Andreas Rheinhardt
7822beed85 avfilter/vf_xpsnr: Fix leaks
This filter uses the AVBuffer API to allocate buffers that are never
shared at all and frees them via av_freep() (actually, it passes
pointers to AVBufferRefs to av_freep, so that only the AVBuffer
structures are freed at all (because AVBufferRef has a AVBuffer* as its
first member), not the AVBufferRef and not the underlying buffers;
and due to a wrong check the AVBuffers corresponding
to buf_org[c] with c>0 were never freed at all). This is a violation
of the AVBuffer API and causes a memleak. Fix this by avoiding the
AVBuffer API altogether.
(The FATE tests don't catch this, because they use piping to awk,
so that the error code from ffmpeg is ignored.)

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-01-12 15:41:40 +01:00
Andreas Rheinhardt
7ab7d9c3c0 avfilter/avfilter: Add FFFilter, hide internals of AVFilter
This patch is analogous to 20f9727018:
It hides the internal part of AVFilter by adding a new internal
structure FFFilter (declared in filters.h) that has an AVFilter
as its first member; the internal part of AVFilter is moved to
this new structure.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-01-12 15:41:40 +01:00
Andreas Rheinhardt
9bbab3255b avfilter/vf_overlay: Remove spec-incompliant ';'
Fixes warnings with -pedantic with GCC and Clang.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-01-12 15:41:40 +01:00
Andreas Rheinhardt
4cf445c75d tests/ref/fate/png-icc-parse: Add lossless flag to ref file
Forgotten in 8a29b4e38d
(this test depends on lcms2 and is therefore disabled by default).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-01-12 15:41:39 +01:00
Andreas Rheinhardt
4973bb661e swscale/cms,graph,lut3d: Use ff_-prefix, don't export internal functions
Symbols with the sws_* prefix are exported.

Reviewed-by: Alexander Strasser <eclipse7@gmx.net>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-01-12 15:41:39 +01:00
Andreas Rheinhardt
0bc1d2fac4 avcodec/aac/aacdec: Fix -Wdeclaration-after-statement
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-01-12 15:41:39 +01:00
Andreas Rheinhardt
b239eefeb5 avcodec/sga: Silence -Wunused-but-set-variable warnings
The variables are used, but only inside an av_assert1().

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-01-12 15:41:39 +01:00
Andreas Rheinhardt
7a5d6690fc avcodec/aac_ac3_parser: Remove unused variable
Added in 64bb91fd3b, never used.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-01-12 15:41:39 +01:00
James Almer
5f6e43f77d tests/fate/lavf-container: fix dependencies for lavf_container_fate tests
Signed-off-by: James Almer <jamrial@gmail.com>
2025-01-12 11:13:35 -03:00
James Almer
df50370e1b avformat/matroska: add support for VVC streams
As defined in https://github.com/ietf-wg-cellar/matroska-specification/blob/master/codec_specs.md#v_mpegiisovvc

Signed-off-by: James Almer <jamrial@gmail.com>
2025-01-12 11:13:31 -03:00
Frank Plowman
8bd66a8c95 lavc/vvc: Check slice structure
The criteria for slice structure validity is similar to that of
subpicture structure validity that we saw not too long ago [1].
The relationship between tiles and slices must satisfy the following
properties:

* Exhaustivity.  All tiles in a picture must belong to a slice.  The
  tiles cover the picture, so this implies the slices must cover the
  picture.
* Mutual exclusivity.  No tile may belong to more than one slice, i.e.
  slices may not overlap.

In most cases these properties are guaranteed by the syntax.  There is
one noticable exception however: when pps_tile_idx_delta_present_flag is
equal to one, each slice is associated with a syntax element
pps_tile_idx_delta_val[i] which "specifies the difference between the
tile index of the tile containing the first CTU in the ( i + 1 )-th
rectangular slice and the tile index of the tile containing the first
CTU in the i-th rectangular slice" [2].  When these syntax elements are
present, the i-th slice can begin anywhere and the usual guarantees
provided by the syntax are lost.

The patch detects slice structures which violate either of the two
properties above, and are therefore invalid, while building the
slice map.  Should the slice map be determined to be invalid, an
AVERROR_INVALIDDATA is returned.  This prevents issues including
segmentation faults when trying to decode,  invalid bitstreams.

[1]: https://ffmpeg.org//pipermail/ffmpeg-devel/2024-October/334470.html
[2]: H.266 (V3) Section 7.4.3.5, Picture parameter set RBSP semantics

Signed-off-by: Frank Plowman <post@frankplowman.com>
2025-01-12 13:15:06 +08:00
Peter Ross
2202dcfc0f avformat/iff: ignore FVER tag when not processing DSD/DST files
Fixes ticket #10030.
2025-01-12 11:14:16 +11:00
Peter Ross
ba22d6a24f avformat/wtvenc: do not output negative 'third timestamp' field
Fixes ticket #3659.
2025-01-12 11:07:57 +11:00
Peter Ross
330470ef24 avformat/mlvdec: skip over some other known block types 2025-01-12 10:55:47 +11:00
Peter Ross
45c30bc51e avformat/mlvdec: process VERS block 2025-01-12 10:55:44 +11:00
Peter Ross
86dd15fd0d avformat/mlvdec: demux LJ92 huffman comressed frames
A minimal DNG header is added to each LJ92 compressed frame, allowing
thme to be decoded by the TIFF decoder. The TIFF decoder is responsible
for setting up the MJPEG decoder, signalling the correct s->bayer flag,
and setting pix_fmt.

The LJ92 compressed frames can be muxed out to DNG files, and manipulated
in DNG software. Tested with darktable and rawtherapee.

Contributor: South East <8billion.people@gmail.com>
2025-01-12 10:55:39 +11:00
f651ca3a68
avutil/frame.h: improve documentation for AV_FRAME_FLAG_LOSSLESS
It should be more clear what this flag is indicating with a more
verbose comment documenting it.

Signed-off-by: Leo Izen <leo.izen@gmail.com>
Reviewed-by: Marton Balint <cus@passwd.hu>
Reviewed-by: Alexander Strasser <eclipse7@gmx.net>
Reviewed-by: Marth64 <marth64@proxyid.net>
2025-01-11 10:31:00 -05:00
b76053d8bf avformat/flvdec: add support for legacy HEVC files 2025-01-10 21:55:23 +01:00