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

44260 Commits

Author SHA1 Message Date
Michael Niedermayer
32d0561891 avcodec/notchlc: Check uncompressed size against input for LZ4
Fixes: OOM
Fixes: 26168/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_NOTCHLC_fuzzer-6019839015256064
Fixes: 28397/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_NOTCHLC_fuzzer-5649039941042176

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-01-03 01:16:25 +01:00
Jan Ekström
ed524136e0 avcodec/videotoolbox: make FFmpeg-to-VT mapping error more informative
Now logs the actual failed-to-map pixel format as well as range.
2021-01-02 14:36:22 +02:00
Andreas Rheinhardt
2c6f532e0a Mark some pointers as const
Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2021-01-01 15:25:48 +01:00
Anton Khirnov
15baa0c1ac lavc/mjpegdec: cosmetics, org->orig 2021-01-01 14:33:47 +01:00
Anton Khirnov
baecaa16c1 mpegvideo: use the AVVideoEncParams API for exporting QP tables
Do it only when requested with the AV_CODEC_EXPORT_DATA_VIDEO_ENC_PARAMS
flag.

Drop previous code using the long-deprecated AV_FRAME_DATA_QP_TABLE*
API. Temporarily disable fate-filter-pp, fate-filter-pp7,
fate-filter-spp. They will be reenabled once these filters are converted
in following commits.
2021-01-01 14:23:19 +01:00
Anton Khirnov
e15371061d lavu/mem: move the DECLARE_ALIGNED macro family to mem_internal on next+1 bump
They are not properly namespaced and not intended for public use.
2021-01-01 14:14:57 +01:00
Anton Khirnov
c8c2dfbc37 lavu: move LOCAL_ALIGNED from internal.h to mem_internal.h
That is a more appropriate place for it.
2021-01-01 14:11:01 +01:00
Andreas Rheinhardt
be1f5bae31 avcodec/svq1dec: Increase nb_bits of VLC to read it in one go
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-12-31 23:42:05 +01:00
Andreas Rheinhardt
4425aa4be5 avcodec/dirac_arith: Make table only used here static
Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-12-31 23:37:53 +01:00
Andreas Rheinhardt
bd46e3ee71 avcodec/qdmc: Mark decoder as init-threadsafe
It already uses ff_thread_once() to initialize its static data.

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-12-31 23:36:37 +01:00
Andreas Rheinhardt
e0311e848a avcodec/opusdec: Mark decoder as init-threadsafe
Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-12-31 23:35:21 +01:00
Andreas Rheinhardt
9f36a5a1cc avcodec/opusdec: Cleanup generically on init failure
Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-12-31 23:35:10 +01:00
Andreas Rheinhardt
f03eade869 avcodec/opusdec: Move per-stream fields to OpusStreamContext
Besides being more natural it also avoids allocations for separate
arrays of decoded samples/output buffers/....

Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-12-31 23:23:03 +01:00
Andreas Rheinhardt
794fb18369 avcodec/opusdec: Return error upon error
The Opus decoder forgot to return an error when allocating an
SwrContext fails.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-12-31 23:21:43 +01:00
Andreas Rheinhardt
4f1ae39036 avcodec/aacps_common: Use minimal VLC nb_bits/max_depth
Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-12-31 23:18:55 +01:00
Andreas Rheinhardt
3693e2fcee avcodec/aacps: Factor out code shared by float and fixed point decoder
Saves about 7KiB.

Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-12-31 22:12:39 +01:00
Andreas Rheinhardt
0d61a1cfad avcodec/mpegvideo: Don't zero-initialize unnecessarily
mbintra_table will be memset to 1 a few lines after its allocation.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-12-31 22:12:01 +01:00
Andreas Rheinhardt
3526f3856a avcodec/aacsbr_template: Remove pointless runtime initialization
The sbr_qmf_window_us array is basically symmetric around its middle
element and therefore the latter half is currently initialized from the
first half at runtime. Yet because the first half is initialized, the
array can't be placed in .bss at all, so that one gains nothing from not
already initializing the whole array statically. Therefore this commit
does exactly this.

(There are two exceptions to the symmetry: Elements 384 and 512 are the
negations of their mirror element; for the fixed-point decoder, Q31(-x)
does not equal -Q31(x). In order to keep the array exactly the same, the
latter form has been used for these two elements.)

Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-12-31 22:04:23 +01:00
Andreas Rheinhardt
df56a1060c avcodec/aacsbr: Remove remnants of tablegen
These tables are always initialized at runtime since commit
cb93df0dcb.

Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-12-31 21:53:55 +01:00
Andreas Rheinhardt
2c3393d15d avcodec/atrac3plus_data: Mark array as const
Forgotten in a7dbeb77c3.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-12-31 21:49:33 +01:00
Andreas Rheinhardt
15072d2753 avcodec/mlpenc: Simplify finding best codebook
Finding the best codebook involves comparing different paths, where each
path is a sequence of several decisions (namely which codebook to use).
Up until now, these sequence was encoded in a NUL-terminated string and
the actual decisions were encoded as ’\0'..'\3' (which encoded 0..3).
This commit modifies this to actually encode it via 0..3 by switching
away from a C-string to a simple array with an explicit length field.

Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-12-31 21:46:01 +01:00
Andreas Rheinhardt
2825ed4e26 avcodec/opusdec: Remove always-true check
The celt_delay AVAudioFifo is always allocated during init, so checking
for its existence in .flush is unnecessary.

Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-12-31 21:43:31 +01:00
Andreas Rheinhardt
7684182921 avcodec/opustab: Make array static
Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-12-31 21:30:51 +01:00
Andreas Rheinhardt
4a160cbef4 avcodec/motion_est, mpegvideo: Make pointers to static storage const
Modifying static storage must not happen because of multithreading
(except initialization of course), so add const to the pointed-to type
for pointers that point to static storage.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-12-31 12:44:12 +01:00
Andreas Rheinhardt
eea2638e9a configure, libavcodec/speedhq: Fix compiling SpeedHQ encoder
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-12-31 12:06:04 +01:00
Andreas Rheinhardt
8af82be946 avcodec/mpegvideo: Merge ff_mpv_decode_defaults into ff_mpv_decode_init
These two are always called directly after each other (with the
exception of the calls in mpeg_decode_init() where some irrelevant
modifications of the avctx (which could just as well be done before
ff_mpv_decode_defaults(), because it doesn't have a pointer to the
AVCodecContext at all and therefore can't see these modifications at
all) are performed in between), so merge ff_mpv_decode_defaults() in
ff_mpv_decode_init().

Reviewed-by: Anton Khirnov <anton@khirnov.net>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-12-31 12:00:15 +01:00
Andreas Rheinhardt
ebbdb928e8 avcodec/h261dec: Don't use too big max_depth in get_vlc2()
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-12-31 11:56:18 +01:00
Andreas Rheinhardt
2b04405b63 avcodec/speedhq: Remove cast
Reviewed-by: Anton Khirnov <anton@khirnov.net>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-12-31 11:54:22 +01:00
Andreas Rheinhardt
0e3272d9a4 avcodec/mpeg12: Reindentation
Reviewed-by: Anton Khirnov <anton@khirnov.net>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-12-31 11:49:43 +01:00
Andreas Rheinhardt
902e16d183 avcodec/mpeg12: Make initializing VLCs thread-safe
This automatically makes the eamad, eatqi, ipu and mdec decoders
init-threadsafe; in addition to the actual mpeg[12]video decoders,
of course.

Reviewed-by: Anton Khirnov <anton@khirnov.net>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-12-31 11:46:20 +01:00
Andreas Rheinhardt
6e8fcd9c56 avcodec/mpeg12: Don't initialize encoder-only parts of RLTable
ff_mpeg12_init_vlcs() currently initializes index_run, max_level and
max_run of ff_rl_mpeg1/2; yet the only user of these fields is the
MPEG-1/2 encoder which already initializes these tables on its own.
So remove the initializations in ff_mpeg12_init_vlcs(); this also
simplifies making ff_mpeg12_init_vlcs() thread-safe.

Reviewed-by: Anton Khirnov <anton@khirnov.net>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-12-31 11:11:59 +01:00
Andreas Rheinhardt
1ead0c6388 avcodec/rl: Remove nonstatic storage of RL tables
ff_rl_free() was added in 324e50ee95,
but never used; nonstatic storage was not used long before that.

Reviewed-by: Anton Khirnov <anton@khirnov.net>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-12-31 10:53:42 +01:00
Aman Karmani
e1d7433100 avcodec/codec_desc: describe AV_CODEC_ID_MPEG2TS
Signed-off-by: Aman Karmani <aman@tmm1.net>
2020-12-28 14:08:44 -08:00
Michael Niedermayer
292e41ce65 avcodec/tiff: Disallow striped and tiled tiffs except for DNG
strips + tiles is not allowed in TIFF
DNG uses a separate codepath

Regression since da5b3d0028.

Fixes: NULL pointer dereference
Fixes: poc1
Fixes: Ticket8960

Found-by: 1vanChen of NSFOCUS Security Team
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-12-28 19:36:57 +01:00
Paul B Mahol
676689cc7c avcodec/cfhd: properly handle midstream size changes for transform type 2 2020-12-25 13:28:39 +01:00
Michael Niedermayer
5cae71d2b7 avcodec/ffv1dec: Fix off by 1 error with quant tables
Fixes: assertion failure
Fixes: 28447/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_FFV1_fuzzer-5369575948550144

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-12-22 00:30:50 +01:00
Michael Niedermayer
2749e20d04 avcodec/fastaudio: Fix invalid shift exponent
Fixes: shift exponent 32 is too large for 32-bit type 'unsigned int'
Fixes: 25434/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_FASTAUDIO_fuzzer-6252363168612352

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-12-19 23:19:29 +01:00
Michael Niedermayer
8aadae670f avcodec/utils: Check bitrate for overflow in get_bit_rate()
Fixes: signed integer overflow: 617890810133996544 * 16 cannot be represented in type 'long'
Fixes: 26565/clusterfuzz-testcase-minimized-ffmpeg_dem_MV_fuzzer-5092054700654592

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-12-19 20:07:56 +01:00
Michael Niedermayer
ad20a4f92b avcodec/hevc_ps: Change scaling_list_dc_coef to 8 bit
Suggested-by: James
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-12-19 20:07:56 +01:00
Michael Niedermayer
f1700bd8bb avcodec/hevc_ps: check scaling_list_dc_coef
Fixes: signed integer overflow: 2147483640 + 8 cannot be represented in type 'int'
Fixes: 28449/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_HEVC_fuzzer-5686013259284480

Reviewed-by: James Almer <jamrial@gmail.com>
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-12-19 20:07:56 +01:00
James Almer
20b09b20a9 avcodec/dpx: fix use of uninitialised value
Found by Valgrind.

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2020-12-18 15:22:16 -03:00
James Almer
2d02cf72e1 avcodec/hevc_sei: return the correct error code on User Data Registered parsing failure
Signed-off-by: James Almer <jamrial@gmail.com>
2020-12-18 12:58:51 -03:00
James Almer
d397d98b59 avcodec/hevc_sei: print a log message when a unsupported ITU-T T35 SEI messages is parsed
Signed-off-by: James Almer <jamrial@gmail.com>
2020-12-18 12:43:30 -03:00
James Almer
d5556377de avcodec/hevc_sei: refactor parsing User Data Registered ITU-T T35 SEI messages
Signed-off-by: James Almer <jamrial@gmail.com>
2020-12-18 12:43:08 -03:00
James Almer
f322383a44 avcodec/h264_sei: print a log message when a unsupported ITU-T T35 SEI messages is parsed
Signed-off-by: James Almer <jamrial@gmail.com>
2020-12-18 12:34:17 -03:00
James Almer
65058cade1 avcodec/h264_sei: refactor parsing User Data Registered ITU-T T35 SEI messages
Signed-off-by: James Almer <jamrial@gmail.com>
2020-12-18 12:34:04 -03:00
Harry Mallon
331858d0f6 avcodec/dpx: Fix B&W film scans from Lasergraphics Inc
Signed-off-by: Harry Mallon <harry.mallon@codex.online>
2020-12-17 13:02:49 +01:00
Harry Mallon
0539f15bbb avcodec/dpx: Read color information from DPX header
Signed-off-by: Harry Mallon <harry.mallon@codex.online>
2020-12-17 13:02:49 +01:00
Harry Mallon
8232e01e41 avcodec/dpx: Report color_range from DPX header
Signed-off-by: Harry Mallon <harry.mallon@codex.online>
2020-12-17 13:02:49 +01:00
Harry Mallon
a041c0a031 avcodec/dpx: Read SMPTE timecode from DPX
Signed-off-by: Harry Mallon <harry.mallon@codex.online>
2020-12-17 13:02:49 +01:00