1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-11-26 19:01:44 +02:00
Commit Graph

114563 Commits

Author SHA1 Message Date
Michael Niedermayer
f30fe5e8d0
avformat/mxfdec: Make edit_unit_byte_count unsigned
Suggested-by: Marton Balint <cus@passwd.hu>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-04-01 18:52:38 +02:00
Michael Niedermayer
d88c284c18
avformat/movenc: Check that cts fits in 32bit
Fixes: Assertion av_rescale_rnd(start_dts, mov->movie_timescale, track->timescale, AV_ROUND_DOWN) <= 0 failed at libavformat/movenc.c:3694
Fixes: poc2

Found-by: Wang Dawei and Zhou Geng, from Zhongguancun Laboratory
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-04-01 18:51:59 +02:00
James Almer
0a693bce62
avformat/iamf_parse: keep count_label consistent on language_label allocation failure
Fixes: null pointer dereference
Fixes: 67023/clusterfuzz-testcase-minimized-ffmpeg_dem_IAMF_fuzzer-6011025237278720

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-04-01 18:17:28 +02:00
Michael Niedermayer
f26ee6e066
avformat/iamf_reader: Check len before summing
Fixes: integer overflow
Fixes: 67275/clusterfuzz-testcase-minimized-ffmpeg_dem_IAMF_fuzzer-5438920751906816
Fixes: 67688/clusterfuzz-testcase-minimized-ffmpeg_dem_IAMF_fuzzer-5970342318243840

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-04-01 18:17:28 +02:00
Michael Niedermayer
d6ed6f6e8d
avformat/mxfdec: Check first case of offset_temp computation for overflow
This is kind of ugly
Fixes: signed integer overflow: 255 * 1157565362826411919 cannot be represented in type 'long'
Fixes: 67313/clusterfuzz-testcase-minimized-ffmpeg_dem_MXF_fuzzer-6250434245230592

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-04-01 18:17:28 +02:00
Michael Niedermayer
7b7eea8e63
avcodec/jpeg2000htdec: warn about non zero roi shift
Suggested-by: Tomas Härdin <git@haerdin.se>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-04-01 18:17:27 +02:00
Michael Niedermayer
19ad05e9e0
avcodec/jpeg2000htdec: Check magp before using it in a shift
Fixes: shift exponent -1 is negative
Fixes: 65378/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_JPEG2000_fuzzer-5457678193197056

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-04-01 18:17:27 +02:00
Anton Khirnov
63f56c9943 doc/community: update conflict of interest rule according to GA vote 2024-04-01 15:38:28 +02:00
Zhao Zhili
7bf85d2d3a avcodec/h264_parse: Fix error code in decode_extradata
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2024-04-01 17:05:21 +08:00
Timo Rothenpieler
271a0a55bc avcodec/nvenc: provide nvenc with monotonic frame index 2024-04-01 00:46:12 +02:00
Timo Rothenpieler
c06e9e289f avcodec/nvenc: update minimum driver version list 2024-03-31 21:43:38 +02:00
Timo Rothenpieler
21b4708969 avcodec/nvenc: add support for unidirectional b-frames 2024-03-31 21:32:55 +02:00
Timo Rothenpieler
a270966118 avcodec/nvenc: add support for uhq tune 2024-03-31 21:17:11 +02:00
Timo Rothenpieler
77d23bcb1b avcodec/nvenc: add support for lookahead_level 2024-03-31 20:58:27 +02:00
Timo Rothenpieler
64e3fc9069 avcodec/nvenc: add support for HEVC temporal filtering 2024-03-31 20:47:59 +02:00
Timo Rothenpieler
06c2a2c425 avcodec/nvenc: support SDK 12.2 bit depth API 2024-03-31 19:10:49 +02:00
Timo Rothenpieler
43b417d516 avcodec/nvenc: stop using long deprecated format specifiers 2024-03-31 19:10:49 +02:00
Andreas Rheinhardt
199c479b9a avcodec/arm/vp8: Don't discard const
Forgotten in 25e1986e68.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-31 00:08:43 +01:00
Andreas Rheinhardt
0e5f71230a avutil/internal: Move avpriv_set_systematic_pal2 decl to imgutils_internal.h
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-31 00:08:43 +01:00
Andreas Rheinhardt
888e2c0a85 avutil/hwcontext_vulkan: Include hwcontext.h
struct Foo * declares a new type (namely struct Foo)
if there is no declaration of struct Foo already visible
in the current scope; otherwise it is just a pointer to
an element of the already declared type "struct Foo".
There is a gotcha with the first case:
struct Foo is only declared in its scope; a later declaration
of struct Foo in an enclosing scope declares a different type.

This happens in hwcontext_vulkan.h if it is included before
hwcontext.h, because some declarations of struct AVHWDeviceContext
and struct AVHWFramesContext have function prototype scope.

Compilers warn about this (during checkheaders):
‘struct AVHWDeviceContext’ declared inside parameter list will not
be visible outside of this definition or declaration

Fix this by including hwcontext.h.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-31 00:08:43 +01:00
Andreas Rheinhardt
0f78b26e9c avutil/internal: Move FF_MEMORY_POISON to its only user
Namely mem.c.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-31 00:08:43 +01:00
Andreas Rheinhardt
8041a91a32 avutil/internal: Move libm inclusion to the beginning
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-31 00:08:43 +01:00
Andreas Rheinhardt
e4e6377afc avcodec/arm/mpegvideo_arm: Use static_assert to check offsets
Also move AV_CHECK_OFFSET to its only user, namely
lavc/arm/mpegvideo_arm.c and rename it to CHECK_OFFSET.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-31 00:08:43 +01:00
Andreas Rheinhardt
790f793844 avutil/common: Don't auto-include mem.h
There are lots of files that don't need it: The number of object
files that actually need it went down from 2011 to 884 here.

Keep it for external users in order to not cause breakages.

Also improve the other headers a bit while just at it.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-31 00:08:43 +01:00
Andreas Rheinhardt
b616be1649 lib*/version: Use static_assert for static asserts
Also update the checks that guard against inserting
a new enum entry in the middle of a range.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-31 00:08:42 +01:00
Andreas Rheinhardt
2d38141ea6 swscale/swscale_internal: Don't export internal function
sws_alloc_set_opts() can actually be made internal to utils.c.
This commit does so.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-31 00:08:42 +01:00
Andreas Rheinhardt
ad1cef04a9 swscale/swscale_internal: Hoist branch out of loop
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-31 00:08:42 +01:00
Andreas Rheinhardt
c8549d480f avcodec/msmpeg4: Don't include x86-specific header unconditionally
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-31 00:08:42 +01:00
Andreas Rheinhardt
a265e8ca92 avcodec, avfilter: Don't use "" for system headers
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-31 00:08:42 +01:00
Andreas Rheinhardt
b49e621c83 swscale/ppc/swscale_altivec: Simplify macro
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-31 00:08:42 +01:00
Andreas Rheinhardt
72f4f1dafb swscale/ppc/swscale_altivec: Fix build with -O0
In this case GCC does not treat a const variable initialized
to the compile-time constant "3" as a compile-time constant
and errors out because the argument is not a literal value.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-31 00:08:42 +01:00
Andreas Rheinhardt
347a70f101 avcodec/pcm-bluray/dvd: Use correct pointer types on BE
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-31 00:08:42 +01:00
Andreas Rheinhardt
cd63dab55c avcodec/mips/ac3dsp_mips: Add missing includes
Likely broken in d7a75d2163.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-31 00:08:42 +01:00
Marton Balint
2df2b4067e avfilter/buffersrc: fix overriding unknown channel layouts with negotiated one
Fixes ffplay playback of unknown layouts, when SDL directly supports the audio
format, such as:

ffplay -f lavfi anullsrc=cl=2C,aformat=s16

Without the patch, "Channel layout change is not supported" errors are
generated because buffersrc (unknown 2 channel) and buffersink (stereo)
negotiated a stereo layout, but the stereo layout was never stored in the
BufferSourceContext.

This fixes a regression of 7251f90972, but this
is more of a regression of the avfilter channel layout conversion
(1f96db959c).

Signed-off-by: Marton Balint <cus@passwd.hu>
2024-03-30 20:59:15 +01:00
Andreas Rheinhardt
ff215d9559 fate/image: Fix EXR tests on big endian
These tests need a scale filter to convert to the prescribed
pixel format (the native format is endian-dependent).

Reviewed-by: Sean McGovern <gseanmcg@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-30 20:33:56 +01:00
James Almer
e37b233ee2 Revert "avformat/mov: ignore item boxes for animated heif"
This reverts commit f6b7b473d4.
The image in the item boxes and the animation in the trak box are not
necessarely the same, so both should be exported.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-03-30 12:25:59 -03:00
James Almer
f8fbec8686 avutil/frame: use the same data information as the source entry when cloning side data
src->{data,size} does not need to match src->buf->{data,size}.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-03-30 10:15:02 -03:00
Andreas Rheinhardt
ba7980d9c0 avutil/opt: Avoid av_uninit
GCC 9-13 do not emit warnings for this at all optimization
levels even when -Wmaybe-uninitialized is not disabled.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-30 05:06:28 +01:00
Andreas Rheinhardt
dc7a60529c avcodec/ratecontrol: Use forward declaration for AVExpr
Avoids including eval.h everywhere where mpegvideo.h
is included.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-30 05:06:28 +01:00
Andreas Rheinhardt
348461e550 avcodec/h264_refs: Use smaller scope, don't use av_uninit
In particular, declare iterators with loop scope.
Also remove av_uninit while at it, because they
are now unnecessary due to the changes of the preceding
commit.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-30 05:06:28 +01:00
Andreas Rheinhardt
ac14d68277 avcodec/h264_refs: Rewrite code to make control flow clearer
While this change IMO makes the control flow clearer
for the human reader, it is especially important for
GCC: It erroneously believes that it is possible to
enter the SHORT2(UNUSED|LONG) cases without having
entered the preceding block that initializes pic,
frame_num, structure and j; it would emit -Wmaybe-uninitialized
warnings for these variables if they were not pseudo-
initialized with av_uninit(). This patch allows to remove
the latter.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-30 05:06:28 +01:00
Andreas Rheinhardt
4b44b5eaf0 swscale/swscale_internal: Only include altivec header iff HAVE_ALTIVEC
Reviewed-by: Sean McGovern <gseanmcg@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-30 05:04:41 +01:00
Andreas Rheinhardt
7d9d400695 postproc/postprocess: Don't generally include arch-specific headers
Reviewed-by: Sean McGovern <gseanmcg@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-30 05:04:27 +01:00
Sean McGovern
f63a87629e fate: fix sub2video_{basic, time_limited} on big-endian targets
The reference file uses BGRA pixel format, so request it here.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-30 05:03:43 +01:00
Timo Rothenpieler
e99c273fec avcodec/nvdec: reset bitstream_len/nb_slices when resetting bitstream pointer 2024-03-30 00:12:23 +01:00
James Almer
547c920193 avcodec/hevc_ps: don't use a fixed sized buffer for parameter set raw data
Allocate it instead, and use it to compare sets instead of the parsed struct.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-03-29 15:34:21 -03:00
Tong Wu
6bf17136a2 avcodec/hevc_ps: fix the problem of memcmp losing effectiveness
HEVCHdrParams* receives a pointer which points to a dynamically
allocated memory block. It causes the memcmp always returning 1.
Add a function to do the comparision. A condition is also added to
avoid malloc(0).

Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: Tong Wu <tong1.wu@intel.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2024-03-29 12:35:54 -03:00
Anton Khirnov
fa110c32b5 lavfi/setpts: unset frame durations
Actual frame durations are, in general, not computable without buffering
a frame.

FIxes #10886
2024-03-29 09:09:40 +01:00
Anton Khirnov
f121d954ac lavf/vf_setpts: unset output framerate
This filter produces VFR output in general.

Avoids dropping frames in the setpts test.
2024-03-29 09:07:13 +01:00
Anton Khirnov
c240ff98b3 lavc/packet: schedule AV_PKT_DATA_QUALITY_FACTOR for removal
It is unused internally and has been marked as deprecated a long time
ago.
2024-03-29 09:01:54 +01:00