Commit graph

118357 commits

Author SHA1 Message Date
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
2f72dc33ff avformat/flvdec: add enhanced audio codecs 2024-12-27 20:24:22 +01:00
70067c829b avformat/flvenc: remove !size check for audio packets
At least flac finishes every stream with an empty side-data only packet,
that would trigger an assertion/error were these checks still in place.
2024-12-27 20:24:22 +01:00
Dennis Sädtler
466a400b94 avformat/flvdec: add support for demuxing multi-track FLV
Based on enhanced-rtmp v2 spec published by Veovera:
https://veovera.github.io/enhanced-rtmp/docs/enhanced/enhanced-rtmp-v2

Signed-off-by: Dennis Sädtler <dennis@obsproject.com>
Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
2024-12-27 20:24:09 +01:00
Dennis Sädtler
d8d0175d3a avformat/flvenc: implement support for multi-track video
Based on enhanced-rtmp v2 spec published by Veovera:
https://veovera.github.io/enhanced-rtmp/docs/enhanced/enhanced-rtmp-v2

This implementation maintains some backwards compatibility by only
writing the track information for track indices > 0. This means that
older FFmpeg versions - and possibly other software - can still read the
first video track properly and skip over unsupported packets.

Signed-off-by: Dennis Sädtler <dennis@obsproject.com>
Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
2024-12-27 20:22:19 +01:00
James Almer
cedd9151f8 avformat/iamf_writer: ensure the stream groups are not empty
Signed-off-by: James Almer <jamrial@gmail.com>
2024-12-27 16:17:51 -03:00
Niklas Haas
59258fb90e swscale/utils: lazily allocate XYZ tables on CONFIG_SMALL
This has the downside of requiring these tables to be recomputed on every
init, but saves ~270 kB of static data.

Signed-off-by: Niklas Haas <git@haasn.dev>
2024-12-26 20:31:36 +01:00
Niklas Haas
60bfafcd8a swscale/utils: add return code to fill_xyztables()
Needed for lazy allocation of XYZ tables.

Signed-off-by: Niklas Haas <git@haasn.dev>
2024-12-26 20:31:36 +01:00
Niklas Haas
af6d52eec6 swscale: use 16-bit intermediate precision for RGB/XYZ conversion
The current logic uses 12-bit linear light math, which is woefully insufficient
and leads to nasty postarization artifacts. This patch simply switches the
internal logic to 16-bit precision.

This raises the memory requirement of these tables from 32 kB to 272 kB.

All relevant FATE tests updated for improved accuracy.

Fixes: #4829
Signed-off-by: Niklas Haas <git@haasn.dev>
Sponsored-by: Sovereign Tech Fund
2024-12-26 20:31:36 +01:00
James Almer
3e6d89cd97 avcodec/cbs_h2645: revert accidental change
This was erroneously included in 7e778586e7.

Reported-by: Zhao Zhili <quinkblack@foxmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2024-12-26 15:46:44 -03:00
Niklas Haas
8cf2d97280 swscale/unscaled: add pal8 -> gbr(a)p special converter
Fixes: #9520
Signed-off-by: Niklas Haas <git@haasn.dev>
Sponsored-by: Sovereign Tech Fund
2024-12-26 19:29:18 +01:00
James Almer
7e778586e7 avcodec/libx265: ignore user set alpha x265-param
It makes no difference when the input has an alpha plane, and may end up in
crashes or undefined behavior if it doesn't.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-12-26 13:41:28 -03:00
James Almer
6ffbc22b53 doc/ffmpeg.texi: replace use of uncommon unicode characters
Addresses ticket #11372

Signed-off-by: James Almer <jamrial@gmail.com>
2024-12-26 13:41:28 -03:00
Gyan Doshi
fe04b93afa ffmpeg_sched: return better error code
The existing code of 'No space left on device' leaves end users confused
since the issue isn't of disk space.
2024-12-26 15:45:00 +05:30
Pradeep Kumar Goudagunta
aa20294b31 fftools/ffmpeg_opt: Fix precedence issue in abs_start_seek calculation
This patch corrects a C operator precedence issue in fftools/ffmpeg_opt.c
where the abs_start_seek calculation did not yield the expected result
due to incorrect placement of parentheses.
2024-12-26 15:44:18 +05:30
3778b1f6f1 avformat/dashdec: reformat and lowercase get_Fragment()
Signed-off-by: Marth64 <marth64@proxyid.net>
2024-12-24 16:36:05 -06:00
Eugene Zemtsov
7c9bde1d0d avformat/mov: fix crash when trying to get a fragment time for a non-existing fragment
Reviewed-by: Dale Curtis <dalecurtis@chromium.org>
Reviewed-by: Marth64 <marth64@proxyid.net>
Signed-off-by: Marth64 <marth64@proxyid.net>
2024-12-24 15:36:30 -06:00
8e8260aabf avcodec/cbs_av1: fix variable shadowing in cbs_av1_split_fragment()
header is previously declared as an int argument then
shadowed in the scope of the loop as a AV1RawOBUHeader.

Signed-off-by: Marth64 <marth64@proxyid.net>
2024-12-24 15:36:17 -06:00
954d55c2a4
avformat/mov: dereference pointer after null check
Fixes: null pointer dereference
Fixes: 383397479/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-4776829338058752

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-24 02:55:52 +01:00
9327093079
avcodec/utils: Fix block align overflow for ADPCM_IMA_WAV
Fixes: signed integer overflow: 529008646 * 8 cannot be represented in type 'int'
Fixes: 383379145/clusterfuzz-testcase-minimized-ffmpeg_dem_CAF_fuzzer-6674045107503104

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-24 02:55:52 +01:00
361d24e6d9
avformat/matroskadec: Check pre_ns for overflow
Fixes: signed integer overflow: -3483479120376300096 - 7442323944145700864 cannot be represented in type 'long'
Fixes: 383187489/clusterfuzz-testcase-minimized-ffmpeg_dem_WEBM_DASH_MANIFEST_fuzzer-4561470580391936

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-24 02:55:51 +01:00
8f4eb0fe03
tools/target_dec_fuzzer: Adjust threshold for EACMV
Fixes: Timeout
Fixes: 382988735/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_EACMV_fuzzer-5278721465974784

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-24 02:55:51 +01:00
fe1aeb499b
tools/target_dec_fuzzer: Adjust threshold for SGA
Fixes: Timeout
Fixes: 382804863/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SGA_fuzzer-5652795669151744

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-24 02:55:51 +01:00
e7230bc503
tools/target_dec_fuzzer: Adjust threshold for MVC1
Fixes: Timeout
Fixes: 378231213/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MVC1_fuzzer-6640960500465664

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-24 02:55:50 +01:00
e8c94e31da
avformat/mov: free stream_info when the surrounding array is freed
Fixes: memleak
Fixes: 378408474/clusterfuzz-testcase-minimized-ffmpeg_dem_MOV_fuzzer-5699368121860096

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-24 02:55:50 +01:00