1
0
mirror of https://git.ffmpeg.org/ffmpeg.git synced 2026-10-28 15:19:38 +03:00
Commit Graph

27050 Commits

Author SHA1 Message Date
Zhao Zhili
fddf881c06 avformat: use int instead of enum for AVOption fields
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2026-02-26 11:40:16 +08:00
Jack Lau
659892cda6 avformat/tls_mbedtls: generate self-signed cert and key when none is provided in listen mode
Signed-off-by: Jack Lau <jacklau1222gm@gmail.com>
2026-02-25 03:27:03 +00:00
Jack Lau
55f5cfafeb avformat/tls_mbedtls: set dtls remote addr in listen mode
Signed-off-by: Jack Lau <jacklau1222gm@gmail.com>
2026-02-25 03:27:03 +00:00
Jack Lau
35ccd5f3de avformat/tls_mbedtls: add dtls support
Signed-off-by: Jack Lau <jacklau1222gm@gmail.com>
2026-02-25 03:27:03 +00:00
Jack Lau
dc4c798970 avformat: Use ff_*_muxer directly
These muxers already set hard dependencies in
configure so they cannot be enabled unless the
dependencies are enabled.

So these error handling is unreachable.

Directly Using ff_*_muxer is simpler than calling
av_guess_format()

Refer to 289cb3beff

Signed-off-by: Jack Lau <jacklau1222gm@gmail.com>
2026-02-25 02:55:43 +00:00
Michael Niedermayer
989d6ddea0 avformat/wtvdec: Check that language is fully read
Fixes: use-of-uninitialized-value
Fixes: 483856523/clusterfuzz-testcase-minimized-ffmpeg_dem_WTV_fuzzer-5221422609006592

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2026-02-24 10:22:37 +00:00
Nariman-Sayed
186e388716 avformat/whip: use ffurl_closep instead of ffurl_close for dtls_uc 2026-02-24 02:58:34 +00:00
Marvin Scholz
64fafd63f0 avformat: remove HLS protocol
The use of this protocol was already discouraged and warned about
for years with the recommendation to use the HLS demuxer instead.
2026-02-23 20:20:20 +01:00
James Almer
40e0463113 avformat/mov: free item_name on infe entry parsing failure
Fixes regression since 28c330d0f3.

Signed-off-by: James Almer <jamrial@gmail.com>
2026-02-22 23:16:15 -03:00
James Almer
c3aa28f23d avformat/mov: check for EOF in more loops
Signed-off-by: James Almer <jamrial@gmail.com>
2026-02-23 00:43:50 +00:00
James Almer
28c330d0f3 avformat/mov: abort if the queried item doesn't exist instead of overwriting it
The check for item presence was insufficient as it would result in the last
item in the array being overwritten if it existed even if the id didn't match.

Fixes: Assertion ref failed at src/libavformat/mov.c:10649
Fixes: clusterfuzz-testcase-minimized-ffmpeg_dem_MOV_fuzzer-5312542695292928
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg

Signed-off-by: James Almer <jamrial@gmail.com>
2026-02-23 00:43:50 +00:00
Nariman-Sayed
9bc4109b23 avformat/tls_openssl: fix memory leak in cert_from_pem_string
When PEM_read_bio_X509 fails, BIO was not freed, causing memory leak.
Free BIO before returning NULL to prevent resource leak.
2026-02-22 22:39:43 +00:00
Andreas Rheinhardt
b22b65f2f8 avformat/hlsenc: Return error upon error, fix shadowing
Introduced in 65fc0db581.

Reviewed-by: Marvin Scholz <epirat07@gmail.com>
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2026-02-22 00:23:00 +01:00
Marvin Scholz
ca011ee754 avformat: Bump version and add APIChanges entry
Needed after the recent addition of the command APIs.
2026-02-21 20:03:52 +01:00
Andreas Rheinhardt
0b77f79191 avutil/attributes_internal: Add attribute_nonstring
This attribute is used to signal to the compiler
that an array object initialized via a string literal
is not a real string and may lack the space for
the trailing zero, as in char fourcc[4]="FOUR".

This is in preparation for enabling
the -Wunterminated-string-initialization warning.

Reviewed-by: J. Dekker <jdek@itanimul.li>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2026-02-20 11:59:37 +01:00
Vignesh Venkat
51349e31fc avformat/whip: Avoid uninitialized pointer read
Do not try to free the io context if it was never allocated.

Fixes coverity #1665383

Signed-off-by: Vignesh Venkatasubramanian <vigneshv@google.com>
2026-02-20 01:12:27 +00:00
Marvin Scholz
e8a07be1c2 avformat: rtsp: fix logging of reply sequence number 2026-02-20 01:31:06 +01:00
Marvin Scholz
8d46d88f05 avformat: rtspdec: fix leaks in rtsp_read_command_reply
Reorder to avoid allocation if there is nothing to read and also solve
a memory leak in that case.

Also make sure to free the RTSPMessageHeader, which is not passed
to the caller.
2026-02-20 01:31:06 +01:00
Romain Beauxis
0be94a16d6 libavformat/oggdec.c: fix ogg_{save,restore,reset} w.r.t. new_extradata. 2026-02-19 16:45:42 +00:00
Marvin Scholz
8030e3b899 avformat: rtspdec: do not allow SET_PARAMETER command too early 2026-02-19 17:18:12 +01:00
Marvin Scholz
da821ec316 avformat: rtspdec: use stored replies for SET_PARAMETER command
Makes the reply reading completely non-blocking and reliably reports
the reply even when interleaved packets are read.
2026-02-19 17:18:12 +01:00
Marvin Scholz
b63f69fccf avformat: rtsp: add functions to allow stored replies
This adds the ability to have a stored reply, needed for the
SET_PARAMETERS command feature to reliably report the reply even
while intermediate packets are read.
2026-02-19 17:18:12 +01:00
Marvin Scholz
5daa45fa01 avformat: rtsp: fix log message formatting 2026-02-19 17:18:12 +01:00
Marvin Scholz
b59471f8c8 avformat: rtsp: do not skip packets in SET_PARAMETER command handling
Return EAGAIN so the client has a chance to read the pending packets
instead of just silently discarding them internally.
2026-02-19 17:18:12 +01:00
Marvin Scholz
6d8950f046 avformat: rtsp: handle interleaved pending packets
Fixes the behavior when calling ff_rtsp_read_reply again after it
was called at another place with return_on_interleaved_data set to
true. Before, it would result in completely corrupting the internal
state as the $ interleaved packet marker would have already been read
which the next run of ff_rtsp_read_reply would look for but never find
it, trying to read packet data as RTSP message.
2026-02-19 17:18:12 +01:00
Marvin Scholz
44065ea878 avformat/rtspdec: Add SET_PARAMETER command support
Add SET_PARAMETER support, this allows sending SET_PARAMETER requests to
the server using the API.
2026-02-19 17:18:12 +01:00
Marvin Scholz
368ecdd3a4 rtsp: expose rtsp_send_cmd_with_content_async
Add the ff_ prefix and move the declaration to the header, so it can
be used in other places like rtspdec in a future commit.
2026-02-19 17:18:11 +01:00
Marvin Scholz
633dcf71e8 avformat: Add new demuxer command API
This new API adds the ability to send commands to the demuxer and also
receive replies to these commands.

It is useful in cases like the RTSP demuxer, where it might be desirable
for the API user to send commands like SET_PARAMETER or PLAY and PAUSE.

Sending and receiving are decoupled, as to not require waiting for a
reply when sending, as with some demuxers and depending on the command
it could be necessary to process further packets in the meantime
before requesting a reply.
2026-02-19 17:18:11 +01:00
Marvin Scholz
cf755be215 lavf: replace read_{play,pause} by a single callback 2026-02-19 17:18:11 +01:00
Romain Beauxis
0e89d993c5 libavformat/oggenc.c: re-initialize stream on new metadata. 2026-02-18 16:25:06 +00:00
Niklas Haas
4cefbc54c4 avformat/http: add missing check to connection re-use
Fixes: https://code.ffmpeg.org/FFmpeg/FFmpeg/issues/21685
Fixes: e03b034e45
See-Also: https://code.ffmpeg.org/FFmpeg/FFmpeg/issues/21693
2026-02-18 12:57:55 +00:00
Michael Niedermayer
237d03717f avformat/icodec: Check size
Fixes: signed integer overflow: 14 + 2147483647 cannot be represented in type 'int'
Fixes: 471688026/clusterfuzz-testcase-minimized-ffmpeg_dem_ICO_fuzzer-5616495813263360

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2026-02-18 08:20:10 +00:00
Jack Lau
cbdb325424 avformat/tls_openssl: update the outdated comments
Loading CA certificate is supported.

Remove unrelated comments.

The underlying socket can be tcp or udp.

Signed-off-by: Jack Lau <jacklau1222gm@gmail.com>
2026-02-17 13:58:14 +00:00
Jack Lau
479c40f595 avformat/tls_openssl: use EINVAL when X509_digest failed
This function just calculate and copy the fingerprint
to the provided buf, will not allocate memory.

It fails when the input (such as cert) is invalid.

Signed-off-by: Jack Lau <jacklau1222gm@gmail.com>
2026-02-17 13:58:14 +00:00
Michael Niedermayer
bce0e22133 avformat/lrcdec: Check ss for finiteness
Fixes: negation of -9223372036854775808 cannot be represented in type 'int64_t' (aka 'long'); cast to an unsigned type to negate this value to itself
Fixes: 471604230/clusterfuzz-testcase-minimized-ffmpeg_dem_LRC_fuzzer-5474264750030848

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2026-02-17 13:49:41 +00:00
Michael Niedermayer
82fbb04d07 avformat/http: Also count redirects from the cache
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2026-02-17 13:43:37 +00:00
Michael Niedermayer
ba3639bc90 avformat/http: allow adjusting the redirect limit
Idea from: BapToutatis and also curl and wget have equivalent options

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2026-02-17 13:43:37 +00:00
Jack Lau
1fd128ef3a avformat/tls_gnutls: update the comment since the underlying socket can be TCP or UDP
Signed-off-by: Jack Lau <jacklau1222gm@gmail.com>
2026-02-17 13:27:09 +00:00
Jack Lau
546d565d07 avformat/tls_gnutls: limit the written size to data MTU
Signed-off-by: Jack Lau <jacklau1222gm@gmail.com>
2026-02-17 13:27:09 +00:00
Marton Balint
693ca902c1 avformat/matroskaenc: write AlphaMode flag for all VP8 and VP9 pixel formats with alpha
Let's check the pixel format descriptor flags instead of hardcoding a specific
pixel format.

Signed-off-by: Marton Balint <cus@passwd.hu>
2026-02-15 20:28:31 +01:00
Marton Balint
9515cb236b avformat/matroskaenc: only write AlphaMode for VP8 and VP9
AlphaMode should indicate whether the BlockAdditional Element with BlockAddID
of "1" contains Alpha data, as defined by to the Codec Mapping for the `CodecID`.

Only VP8 and VP9 Codec Mappings define this, so writing it for all codecs with
a pixel format of YUVA420P, or for codecs other than VP8/VP9 (if the alpha_mode
metadata entry was set) was wrong.

Signed-off-by: Marton Balint <cus@passwd.hu>
2026-02-15 20:28:31 +01:00
Michael Niedermayer
6ee3e59ce2 avformat/flvdec: Check *size in cts parsing
Fixes: Assertion buf_size >= 0 failed
Fixes: 471553942/clusterfuzz-testcase-minimized-ffmpeg_dem_KUX_fuzzer-5982849812725760

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2026-02-15 06:37:19 +00:00
James Almer
e1484a30e5 avformat/dtshddec: properly support priming and padding samples
Don't just export initial_padding, but also take it into account for timestamps
by adjusting the stream's start_time. Also, export the padding samples in a way
that's actually supported, as currently trailing_padding is unused so no user
will look at it.

For the sake of not reducing coverage and because the lossy tests have reference
files that contain the priming samples, add the skip_manual flags2 to the tests
so we still output them. A new ffprobe call will ensure the demuxer behavior is
tested too.

Signed-off-by: James Almer <jamrial@gmail.com>
2026-02-12 09:59:54 -03:00
Rost Kurylo
95101ecc65 avformat/unix: Fix 'operation unsupported' error when reading from unixgram sockets
Sockets of type SOCK_DGRAM don't support listen(), so it was
impossible to read from "unixgram" sockets in ffmpeg.

Signed-off-by: Rost Kurylo <rost.kurylo@netint.ca>
2026-02-11 20:41:49 +00:00
Nicolas Gaullier
f9bf45b8fd avformat/isom_tags: add specific fourccs for in24/in32 LE
Add support for decoding 42ni and 23ni in mov/mp4.

Note that in24/in32 can be either LE or BE thanks to enda atom,
so this patch leaves the muxer unchanged.

Fixes #21445.

Signed-off-by: Nicolas Gaullier <nicolas.gaullier@cji.paris>
2026-02-11 20:39:31 +00:00
Michael Niedermayer
4f97e52042 avformat/cafdec: Check nb_entries in read_info_chunk()
Fixes: Timeout
Fixes: 477315122/clusterfuzz-testcase-minimized-ffmpeg_dem_CAF_fuzzer-5274792315125760

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2026-02-11 01:17:30 +00:00
Andreas Rheinhardt
f6d89a7bed avformat/spdif: Make enum IEC61937DataType at least 16bits
Fixes the spdif-dca-master FATE-test when compiling with
-fshort-enums.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2026-02-10 19:44:46 +01:00
Andreas Rheinhardt
fcfb33922f avformat/cafenc: don't keep track of nb packets ourselves
Just reuse AVStream.nb_frames.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2026-02-10 11:32:56 +01:00
Andreas Rheinhardt
96475bfa21 avformat/cafenc: Simplify writing pakt box
Assemble it already in caf_write_packet(). This has the advantage
of reducing the amount of buffers used; it also allows to avoid
a seek when writing the trailer and avoids function call overhead
(for the avio_w8(); it also reduces codesize).

Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2026-02-10 11:31:17 +01:00
Michael Niedermayer
521d18cea3 avformat/img2dec: Check avio_size() for failure
More complete fix for #YWH-PGM40646-32

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2026-02-10 01:19:00 +01:00