1
mirror of https://git.videolan.org/git/ffmpeg.git synced 2024-08-03 09:49:58 +02:00
Commit Graph

106556 Commits

Author SHA1 Message Date
James Almer
b65ce7bed8 Revert "avcodec/av1dec: Check tile_cols"
This reverts commit 4fdfe430c1.

The previous commit ensures this field will never be zero.

Signed-off-by: James Almer <jamrial@gmail.com>
2022-03-23 12:03:57 -03:00
James Almer
5670eddf8c avcodec/av1: only set the private context pix_fmt field if get_pixel_format() succeeds
Otherwise get_pixel_format() will not be called when parsing a subsequent Sequence
Header in non hwaccel enabled scenarios, allowing frame parsing when it shouldn't.

This prevents the scenario seqhdr -> frame_hdr/redundant_frame_hdr -> seqhdr ->
redundant_frame_hdr from having the latter redundant frame header parsed as if it
was a frame header by the decoder because the former was discarded.
Since CBS did not discard it, the latter redundant frame header is output with a
zeroed AV1RawFrameHeader struct, which can have undesired results, like division
by zero with fields normally guaranteed to be anything else.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: James Almer <jamrial@gmail.com>
2022-03-23 12:03:57 -03:00
Christopher Degawa
51c0b9e829 avcodec/libsvtav1: pass color description info
Signed-off-by: Christopher Degawa <ccom@randomderp.com>
2022-03-23 16:28:15 +02:00
Oneric
66901ce162 avfilter/vf_subtitles: pass storage size to libass
Due to a quirk of the ASS format some tags depend on the exact storage
resolution of the video, so tell libass via ass_set_storage_size.

Reviewed-by: Soft Works <softworkz@hotmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2022-03-23 09:08:49 -03:00
Anton Khirnov
1728ad8293 fftools/cmdutils: drop redundant code
It allocates a dummy sws/swr context and tries setting options on it,
apparently to check if they are valid. This is redundant, since the
options will be checked if/when they are later applied on a context that
is actually used for conversion.
2022-03-22 18:49:43 +01:00
Anton Khirnov
bd0cbebf3e fftools: drop the fake "default" option from ffplay/ffprobe
It tries to process any unhandled options as AVOptions. Handle this
directly in cmdutils.c, without resorting to a confusing fake option
definition (which is currently visible to the users in -help output).
2022-03-22 18:49:43 +01:00
Anton Khirnov
1dd6363581 fftools/ffprobe: drop -show_format_entry
Deprecated since 2012.
2022-03-22 18:49:43 +01:00
Anton Khirnov
6fd1cd6053 fftools/ffplay: drop options deprecated since 2011 2022-03-22 18:49:43 +01:00
Anton Khirnov
8d293918b5 fftools/ffmpeg: drop mistakenly added empty line 2022-03-22 18:49:43 +01:00
Anton Khirnov
00da464658 fftools: move opt_timelimit from cmdutils to ffmpeg
This option is only supported by ffmpeg.
2022-03-22 18:49:43 +01:00
Anton Khirnov
a545cb2b9d fftools/cmdutils: split common option handlers into their own file 2022-03-22 18:49:43 +01:00
Anton Khirnov
c99b93c5d5 fftools: drop useless indirection 2022-03-22 18:49:43 +01:00
Anton Khirnov
5e51f5af33 fftools/cmdutils: drop extern declarations for nonexistent variables 2022-03-22 18:49:43 +01:00
Anton Khirnov
e46d8c53a3 fftools/cmdutils: drop prototypes for nonexistent functions 2022-03-22 18:49:43 +01:00
Anton Khirnov
1b7ecb3eef avfilter: handle duplicates in the options string
Use the same logic as fftools/cmdutils - when a flag-type option starts
with [+-], append it to the existing value.
2022-03-22 18:49:43 +01:00
Anton Khirnov
a0f04433f4 avfilter: simplify processing child context options
THe call to av_opt_set() is redundant, since the option is written in
the options dict, which is later passed to avfilter_init_dict().
2022-03-22 18:49:43 +01:00
Zhao Zhili
303ddab7ea avfilter/video: fix shadowed variable
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2022-03-22 18:49:30 +01:00
Limin Wang
42f1be4461 avformat/movenc: use warning log level and small adjustment for the log
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
2022-03-22 23:00:53 +08:00
Limin Wang
fc8a6a6f4c avformat/movenc: initialize pts/dts of timecode packet
Fix below error message when timecode packet is written.
"Application provided duration: -9223372036854775808 / timestamp: -9223372036854775808 is out of range for mov/mp4 format"

try to reproduce by:
ffmpeg -y -f lavfi -i color -metadata "timecode=00:00:00:00" -t 1 test.mov

Note although error message is printed, the timecode packet will be written anyway. So
the patch 2/2 will try to change the log level to warning.

Fixes ticket #9488

Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
2022-03-22 23:00:53 +08:00
James Almer
e78173557d ffmpeg: make the ac option set the demuxer's ch_layout AVOption
channels is deprecated on all supported raw demuxers.

Signed-off-by: James Almer <jamrial@gmail.com>
2022-03-22 08:45:39 -03:00
James Almer
639c2f0049 ffmpeg: add a ch_layout option as an alias to channel_layout
This ensures it's parsed as a CLI option instead of the AVCodecContext AVOption.

Signed-off-by: James Almer <jamrial@gmail.com>
2022-03-22 08:45:38 -03:00
James Almer
bc99e3a9d6 ffmpeg: replace custom channel_layout code with an SpecifierOpt based one
This is cleaner and allows fine tuning which stream the option is applied to.

Signed-off-by: James Almer <jamrial@gmail.com>
2022-03-22 08:45:38 -03:00
James Almer
e6e86a3907 avformat/test/seek: set ch_layout instead of channels
Signed-off-by: James Almer <jamrial@gmail.com>
2022-03-22 08:45:38 -03:00
James Almer
edd26bca60 avformat/dfpwmdec: add support to set channel layout
Signed-off-by: James Almer <jamrial@gmail.com>
2022-03-22 08:45:38 -03:00
James Almer
e42e54fa4e avformat/pcmdec: add support to set channel layout in sln demuxer
Deprecate the channels option, and ensure ch_layout has priority if set over
channels, until the latter is gone.

Signed-off-by: James Almer <jamrial@gmail.com>
2022-03-22 08:45:38 -03:00
James Almer
5cd6cb9f05 avformat/pcmdec: deprecate channels option
And ensure ch_layout has priority if set over channels, until the latter is
gone.

Signed-off-by: James Almer <jamrial@gmail.com>
2022-03-22 08:45:34 -03:00
Paul B Mahol
902ee9cafc avcodec/binkaudio: add support for >2 channels dct codec
As presented in .binka files.
2022-03-22 11:03:03 +01:00
Andreas Rheinhardt
fa989df1c6 avcodec/internal: Move FF_DEFAULT_QUANT_BIAS to mpegvideoenc.h
Only used there.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-03-21 23:25:36 +01:00
Andreas Rheinhardt
86c909558c avcodec/internal: Move FF_SIGNBIT and ff_log2_run to mathops.h
It is a more fitting place for them.
Also move the definition of ff_log2_run to mathtables.c.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-03-21 23:25:36 +01:00
Andreas Rheinhardt
495de744fa avcodec/bitstream: Move code for initializing VLCs to file of its own
bitstream.c is currently the disjoint union of three parts:
The first part is ff_log2_run, the second part are some auxiliary
functions for the PutBits-API; and the third part is the code
for creating VLCs. This commit moves the latter into a file of its own.
This has the advantage of making one of the hacks in tableprint_vlc.h
redundant as vlc.c does not include config.h (whereas the PutBits-API
part does).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-03-21 23:25:36 +01:00
Andreas Rheinhardt
b303f1e083 avcodec/mathops: Move bitswap_32() to its only user
Effectively reverts eaff1aa09e
given that bitswap_32 is no longer used outside of bitstream.c
since 03008c2811.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-03-21 23:25:36 +01:00
Michael Niedermayer
7aebdb8bf1 avformat/mxfdec: Do not clear array in mxf_read_strong_ref_array() before writing
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2022-03-21 22:27:14 +01:00
Michael Niedermayer
8d6f49cfc3 avformat/mxfdec: Check for avio_read() failure in mxf_read_strong_ref_array()
Fixes: 42827/clusterfuzz-testcase-minimized-ffmpeg_dem_MXF_fuzzer-4900528511909888

Reviewed-by: Tomas Härdin <tjoppen@acc.umu.se>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2022-03-21 22:27:14 +01:00
Michael Niedermayer
3015c556f3 avformat/mxfdec: Check count in mxf_read_strong_ref_array()
Reviewed-by: Tomas Härdin <tjoppen@acc.umu.se>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2022-03-21 22:27:14 +01:00
Michael Niedermayer
dd1ce72e68 avcodec/allcodecs: Dont play with NULLs
Fixes: member access within null pointer of type 'const FFCodec' (aka 'const struct FFCodec')
Fixes: 45726/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-6554445419249664

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2022-03-21 22:27:14 +01:00
Michael Niedermayer
4fdfe430c1 avcodec/av1dec: Check tile_cols
Fixes: division by zero
Fixes: 43769/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_AV1_fuzzer-5392562205097984
Fixes: 43950/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_AV1_fuzzer-5769210217758720

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2022-03-21 22:27:14 +01:00
James Almer
6bab6afecc avcodec/wmaprodec: ensure channel count in the private context and decoder context are consistent
avctx->ch_layout will be reinitialized using channel_mask later in the
function.

Fixes: 45736/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_WMAPRO_fuzzer-5769886813519872

Signed-off-by: James Almer <jamrial@gmail.com>
2022-03-21 16:12:04 -03:00
James Almer
37f4440682 avformat/demux: ensure ch_layout is not lost in the stream's internal avctx
This is a workaround until avcodec_close() stops freeing ch_layout through
av_opt_fre(), or the former is removed.

Fixes a regression since 327efa6633.

Signed-off-by: James Almer <jamrial@gmail.com>
2022-03-21 08:50:28 -03:00
Gyan Doshi
505a7d39cd doc/bitstream_filters: add missing options in h264_metadata 2022-03-21 16:00:02 +05:30
Michael Niedermayer
a8fd3f7fab avformat/hls: Check target_duration
Fixes: signed integer overflow: 77777777777777 * 1000000 cannot be represented in type 'long long'
Fixes: 45545/clusterfuzz-testcase-minimized-ffmpeg_dem_HLS_fuzzer-6438101247983616

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Steven Liu <lingjiujianke@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2022-03-21 09:07:58 +01:00
Michael Niedermayer
23e27a360e avcodec/mlpdec: Use 64bit for channel layout
Fixes: shift exponent 33 is too large for 32-bit type 'int'
Fixes: 45645/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TRUEHD_fuzzer-5651350182035456

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2022-03-21 09:07:58 +01:00
Michael Niedermayer
0c1f20c6c8 avcodec/pixlet: Avoid signed integer overflow in scaling in filterfn()
Fixes: signed integer overflow: 11494 * 1073741824000000 cannot be represented in type 'long'
Fixes: 26586/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_PIXLET_fuzzer-5752633970917376

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2022-03-21 09:07:58 +01:00
Andreas Rheinhardt
5aabb2596f avcodec/codec_internal: Rename AVCodecDefault->FFCodecDefault
This structure is no longer declared in a public header,
so using an FF-prefix is more appropriate.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-03-21 01:33:10 +01:00
Andreas Rheinhardt
20f9727018 avcodec/codec_internal: Add FFCodec, hide internal part of AVCodec
Up until now, codec.h contains both public and private parts
of AVCodec. This exposes the internals of AVCodec to users
and leads them into the temptation of actually using them
and forces us to forward-declare structures and types that
users can't use at all.

This commit changes this by adding a new structure FFCodec to
codec_internal.h that extends AVCodec, i.e. contains the public
AVCodec as first member; the private fields of AVCodec are moved
to this structure, leaving codec.h clean.

Reviewed-by: Anton Khirnov <anton@khirnov.net>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-03-21 01:33:09 +01:00
Andreas Rheinhardt
a688f3c13c avcodec/internal: Move FF_CODEC_CAP_* to a new header codec_internal.h
Also move FF_CODEC_TAGS_END as well as struct AVCodecDefault.
This reduces the amount of files that have to include internal.h
(which comes with quite a lot of indirect inclusions), as e.g.
most encoders don't need it. It is furthemore in preparation
for moving the private part of AVCodec out of the public codec.h.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-03-21 01:33:09 +01:00
Marton Balint
5b3732227e avfilter/x86/vf_blend: use unaligned movs for output
Fixes crashes with:

ffmpeg -f lavfi -i allyuv=d=1 -vf tblend=difference128,pad=5000:ih:1 -f null x

Signed-off-by: Marton Balint <cus@passwd.hu>
2022-03-21 00:50:44 +01:00
Zhao Zhili
117672c814 ffplay: don't shadow global variable
Signed-off-by: Marton Balint <cus@passwd.hu>
2022-03-21 00:48:30 +01:00
Zhao Zhili
269ed0a413 ffplay: check AVFMT_NO_BYTE_SEEK flag for seek_by_bytes
Signed-off-by: Marton Balint <cus@passwd.hu>
2022-03-21 00:48:30 +01:00
Zhao Zhili
92053aa260 avformat/hls: add AVFMT_NO_BYTE_SEEK flag
After d6ac6650b9, ffplay failed to seek HLS stream with AVSEEK_FLAG_BYTE
enabled by default.

Signed-off-by: Marton Balint <cus@passwd.hu>
2022-03-21 00:48:30 +01:00
James Almer
efdde028bb avcodec/opus: always use ambisonic layout for mapping family 2
No need to use a Custom layout when the non diegetic channels can be
described as a standard mask.

This fixes:

45684/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_LIBOPUS_fuzzer-5039410989629440

Signed-off-by: James Almer <jamrial@gmail.com>
2022-03-20 19:23:12 -03:00