]> git.sesse.net Git - ffmpeg/log
ffmpeg
3 years agoavformat/hlsenc: use AV_OPT_TYPE_DURATION
Limin Wang [Sun, 17 Jan 2021 01:07:28 +0000 (09:07 +0800)]
avformat/hlsenc: use AV_OPT_TYPE_DURATION

Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
3 years agoavformat/rmdec: Fix codecdata_length overflow check
Michael Niedermayer [Fri, 18 Dec 2020 22:13:58 +0000 (23:13 +0100)]
avformat/rmdec: Fix codecdata_length overflow check

Fixes: signed integer overflow: 2147483647 + 64 cannot be represented in type 'int'
Fixes: 28509/clusterfuzz-testcase-minimized-ffmpeg_dem_IVR_fuzzer-6310969680723968
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavcodec/simple_idct: Fix undefined integer overflow in idct4row()
Michael Niedermayer [Thu, 17 Dec 2020 23:31:08 +0000 (00:31 +0100)]
avcodec/simple_idct: Fix undefined integer overflow in idct4row()

Fixes: signed integer overflow: -1498310196 - 902891776 cannot be represented in type 'int'
Fixes: 28445/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_VC1IMAGE_fuzzer-5075163389493248
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavformat/wavdec: Check block_align vs. channels before combining them
Michael Niedermayer [Sun, 17 Jan 2021 22:16:46 +0000 (23:16 +0100)]
avformat/wavdec: Check block_align vs. channels before combining them

Fixes: signed integer overflow: 65535 * 65312 cannot be represented in type 'int'
Fixes: 26910/clusterfuzz-testcase-minimized-ffmpeg_dem_WAV_fuzzer-6606935226974208
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavformat/tta: Use 64bit intermediate for index
Michael Niedermayer [Sun, 17 Jan 2021 21:57:28 +0000 (22:57 +0100)]
avformat/tta: Use 64bit intermediate for index

Fixes: signed integer overflow: 42032 * 51092 cannot be represented in type 'int'
Fixes: 26910/clusterfuzz-testcase-minimized-ffmpeg_dem_TTA_fuzzer-6679539648430080
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavformat/soxdec: Check channels to be positive
Michael Niedermayer [Sun, 17 Jan 2021 21:52:59 +0000 (22:52 +0100)]
avformat/soxdec: Check channels to be positive

Fixes: signed integer overflow: 32 * -1795162112 cannot be represented in type 'int'
Fixes: 26910/clusterfuzz-testcase-minimized-ffmpeg_dem_SOX_fuzzer-6724151473340416
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavformat/smacker: Check for too small pts_inc
Michael Niedermayer [Sun, 17 Jan 2021 21:14:03 +0000 (22:14 +0100)]
avformat/smacker: Check for too small pts_inc

Fixes: negation of -2147483648 cannot be represented in type 'int'; cast to an unsigned type to negate this value to itself
Fixes: 26910/clusterfuzz-testcase-minimized-ffmpeg_dem_SMACKER_fuzzer-6705429132476416
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavformat/sccdec: Use larger intermediate for ts/next_ts computation
Michael Niedermayer [Sun, 17 Jan 2021 21:10:02 +0000 (22:10 +0100)]
avformat/sccdec: Use larger intermediate for ts/next_ts computation

Fixes: signed integer overflow: 92237203 * 33 cannot be represented in type 'int'
Fixes: 26910/clusterfuzz-testcase-minimized-ffmpeg_dem_SCC_fuzzer-6603769487949824
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavcodec/cri: Use ff_set_dimensions()
Michael Niedermayer [Mon, 1 Feb 2021 19:18:14 +0000 (20:18 +0100)]
avcodec/cri: Use ff_set_dimensions()

Fixes: out of memory
Fixes: 29985/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_CRI_fuzzer-6424425392111616
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>
3 years agoavcodec/aacps_fixed_tablegen: Don't include config.h
Andreas Rheinhardt [Thu, 28 Jan 2021 15:19:23 +0000 (16:19 +0100)]
avcodec/aacps_fixed_tablegen: Don't include config.h

It is only valid for the target, not the host and therefore it must not
be included when building the tables when hardcoded tables are enabled.

Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoavformat/mxf: Establish register of local tags
Tomas Härdin [Wed, 27 Jan 2021 13:08:55 +0000 (14:08 +0100)]
avformat/mxf: Establish register of local tags

Tags can be marked "not used" upfront, saving some space in the primer.
av_asserts0() is used to enforce that only tags that are in the primer can actually be written.
Sharing of MasteringDisplay ULs is now done via macros.

3 years agoavformat/sbgdec: Use av_sat_add64() in str_to_time()
Michael Niedermayer [Sun, 31 Jan 2021 19:55:53 +0000 (20:55 +0100)]
avformat/sbgdec: Use av_sat_add64() in str_to_time()

Fixes: signed integer overflow: 7279992792120000000 + 4611686018427387904 cannot be represented in type 'long long'
Fixes: 29744/clusterfuzz-testcase-minimized-ffmpeg_dem_SBG_fuzzer-6434060249464832
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Nicolas George <george@nsup.org>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavcodec/aac_ac3_parser: fix channel information parsing in case decoder is disabled
Piotr Uracz [Mon, 25 Jan 2021 11:04:36 +0000 (12:04 +0100)]
avcodec/aac_ac3_parser: fix channel information parsing in case decoder is disabled

Fixes #7372

3 years agoavformat/rtpdec: Avoid allocations of small dynamic buffers
Andreas Rheinhardt [Wed, 27 Jan 2021 14:57:19 +0000 (15:57 +0100)]
avformat/rtpdec: Avoid allocations of small dynamic buffers

Besides avoiding allocations this also fixes a design defect of
ff_rtp_send_punch_packets: It did not return an error in case of
these allocations failed.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoavfilter/vf_vibrance: add packed formats support
Paul B Mahol [Sun, 31 Jan 2021 19:52:22 +0000 (20:52 +0100)]
avfilter/vf_vibrance: add packed formats support

3 years agoavfilter/vf_colortemperature: add packed formats support
Paul B Mahol [Sun, 31 Jan 2021 19:39:45 +0000 (20:39 +0100)]
avfilter/vf_colortemperature: add packed formats support

3 years agoavfilter/vf_colortemperature: use macro for identical code
Paul B Mahol [Sun, 31 Jan 2021 19:24:04 +0000 (20:24 +0100)]
avfilter/vf_colortemperature: use macro for identical code

3 years agoavcodec/cscd: Check output len in zlib as in lzo
Michael Niedermayer [Wed, 11 Nov 2020 22:17:50 +0000 (23:17 +0100)]
avcodec/cscd: Check output len in zlib as in lzo

Fixes: Timeout (>10sec -> 134ms)
Fixes: 27245/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_CSCD_fuzzer-575318210772992
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavcodec/vp3: Check input amount in theora_decode_header()
Michael Niedermayer [Fri, 29 Jan 2021 23:46:26 +0000 (00:46 +0100)]
avcodec/vp3: Check input amount in theora_decode_header()

Fixes: Timeout
Fixes: 29226/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_THEORA_fuzzer-6195092572471296
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>
3 years agoavformat/wavdec: Check avio_get_str16le() for failure
Michael Niedermayer [Fri, 29 Jan 2021 22:58:04 +0000 (23:58 +0100)]
avformat/wavdec: Check avio_get_str16le() for failure

Fixes: out of array access
Fixes: 29195/clusterfuzz-testcase-minimized-ffmpeg_dem_W64_fuzzer-5037853281222656
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>
3 years agoavcodec/pnm: disable check for PFM as it is not needed
Paul B Mahol [Sun, 31 Jan 2021 13:04:51 +0000 (14:04 +0100)]
avcodec/pnm: disable check for PFM as it is not needed

3 years agoffmpeg: remove dead code for -vol
Gyan Doshi [Sun, 31 Jan 2021 04:51:54 +0000 (10:21 +0530)]
ffmpeg: remove dead code for -vol

It is applied via configure_input_audio_filter()

3 years agodoc/ffmpeg: document apad option
Gyan Doshi [Sun, 31 Jan 2021 04:32:18 +0000 (10:02 +0530)]
doc/ffmpeg: document apad option

3 years agoavfilter/af_acrusher: add commands support
Paul B Mahol [Sat, 30 Jan 2021 22:39:55 +0000 (23:39 +0100)]
avfilter/af_acrusher: add commands support

3 years agoavfilter/vf_lagfun: add support for commands
Paul B Mahol [Sat, 30 Jan 2021 16:23:26 +0000 (17:23 +0100)]
avfilter/vf_lagfun: add support for commands

3 years agoavfilter/vf_weave: add slice threading support
Paul B Mahol [Sat, 30 Jan 2021 15:55:56 +0000 (16:55 +0100)]
avfilter/vf_weave: add slice threading support

3 years agoavfilter/vf_blackdetect: add slice threading support
Paul B Mahol [Sat, 30 Jan 2021 15:04:28 +0000 (16:04 +0100)]
avfilter/vf_blackdetect: add slice threading support

3 years agoavcodec/dolby_e: Avoid duplicating sample rate table
Andreas Rheinhardt [Tue, 26 Jan 2021 16:14:05 +0000 (17:14 +0100)]
avcodec/dolby_e: Avoid duplicating sample rate table

Set the sample rate when parsing the header instead and only copy the
value in the decoder and the parser.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoavcodec/dolby_e: Avoid code duplication when converting input
Andreas Rheinhardt [Tue, 26 Jan 2021 15:33:01 +0000 (16:33 +0100)]
avcodec/dolby_e: Avoid code duplication when converting input

convert_input, a nontrivial auxiliary function used by both the general
parsing code as well as the decoder itself, has been duplicated in
c7016e35a624a75bb5b82bee932ddfe28d013b3f; this commit removes said
duplication.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoavcodec/dolby_e_parse: Merge ff_dolby_e_parse_init/header
Andreas Rheinhardt [Tue, 26 Jan 2021 14:46:15 +0000 (15:46 +0100)]
avcodec/dolby_e_parse: Merge ff_dolby_e_parse_init/header

These two functions are always called after another; after all, what
ff_dolby_e_parse_init does is obviously part of parsing the frame header.

Also move the DolbyEHeaderInfo into DBEContext so that parsing the frame
header only needs one struct (both users used a DBEContext immediately
followed by a separate DolbyEHeaderInfo).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoavcodec/dolby_e_parser: Remove unused ParseContext
Andreas Rheinhardt [Tue, 26 Jan 2021 13:48:01 +0000 (14:48 +0100)]
avcodec/dolby_e_parser: Remove unused ParseContext

Parsers are not forced to use a ParseContext and the other stuff from
parser.h which is just designed to help parsers recombining frames. But
this parser does not do this at all, i.e. the ParseContext is unused.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoavfilter/vf_pseudocolor: allow more advanced presets
Paul B Mahol [Fri, 29 Jan 2021 18:45:21 +0000 (19:45 +0100)]
avfilter/vf_pseudocolor: allow more advanced presets

3 years agoavfilter/vf_lut3d: add prism interpolation
Paul B Mahol [Wed, 27 Jan 2021 17:44:25 +0000 (18:44 +0100)]
avfilter/vf_lut3d: add prism interpolation

3 years agoavfilter/vf_lut3d: add pyramid interpolation
Paul B Mahol [Wed, 27 Jan 2021 13:37:10 +0000 (14:37 +0100)]
avfilter/vf_lut3d: add pyramid interpolation

3 years agoavformat/flvdec: Check for EOF in amf_skip_tag()
Michael Niedermayer [Tue, 12 Jan 2021 20:54:31 +0000 (21:54 +0100)]
avformat/flvdec: Check for EOF in amf_skip_tag()

Fixes: Timeout
Fixes: 29070/clusterfuzz-testcase-minimized-ffmpeg_dem_KUX_fuzzer-5650106766458880
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavformat/asfdec_o: Check lang_idx
Michael Niedermayer [Tue, 12 Jan 2021 20:45:38 +0000 (21:45 +0100)]
avformat/asfdec_o: Check lang_idx

Fixes: index 26981 out of bounds for type 'ASFStreamData [128]'
Fixes: 27334/clusterfuzz-testcase-minimized-ffmpeg_dem_ASF_O_fuzzer-6197611002068992
Alternatively the array could be increased in size or the cases not fitting be ignored

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavformat/aiffdec: Check size before subtraction in get_aiff_header()
Michael Niedermayer [Tue, 10 Nov 2020 22:01:12 +0000 (23:01 +0100)]
avformat/aiffdec: Check size before subtraction in get_aiff_header()

Fixes: Infinite loop
Fixes: 27235/clusterfuzz-testcase-minimized-ffmpeg_dem_AIFF_fuzzer-5761398380167168
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavformat/utils: Use av_sat_sub64() in max_analyze_duration check
Michael Niedermayer [Tue, 10 Nov 2020 21:27:47 +0000 (22:27 +0100)]
avformat/utils: Use av_sat_sub64() in max_analyze_duration check

Fixes: signed integer overflow: 9223372036854710272 - -541165944832 cannot be represented in type 'long'
Fixes: 27000/clusterfuzz-testcase-minimized-ffmpeg_dem_IVF_fuzzer-5643670608674816
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavformat/electronicarts: More chunk_size checks
Michael Niedermayer [Tue, 12 Jan 2021 21:18:59 +0000 (22:18 +0100)]
avformat/electronicarts: More chunk_size checks

Fixes: Timeout
Fixes: 26909/clusterfuzz-testcase-minimized-ffmpeg_dem_EA_fuzzer-6489496553783296
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavcodec/cfhd: check peak.offset
Michael Niedermayer [Sat, 7 Nov 2020 23:08:35 +0000 (00:08 +0100)]
avcodec/cfhd: check peak.offset

Fixes: signed integer overflow: -2147483648 - 4 cannot be represented in type 'int'
Fixes: 26907/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_CFHD_fuzzer-5746202330267648
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavformat/tedcaptionsdec: Check for overflow in parse_int()
Michael Niedermayer [Sat, 7 Nov 2020 20:11:32 +0000 (21:11 +0100)]
avformat/tedcaptionsdec: Check for overflow in parse_int()

Fixes: signed integer overflow: 1111111111111111111 * 10 cannot be represented in type 'long'
Fixes: 26892/clusterfuzz-testcase-minimized-ffmpeg_dem_TEDCAPTIONS_fuzzer-5756045055754240
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavcodec/vorbis_data: Move encoder-related table to its only user
Andreas Rheinhardt [Thu, 28 Jan 2021 23:14:09 +0000 (00:14 +0100)]
avcodec/vorbis_data: Move encoder-related table to its only user

Said table was unused in case libvorbis was disabled.

Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoavcodec/fft_template: Avoid useless function
Andreas Rheinhardt [Thu, 28 Jan 2021 23:06:20 +0000 (00:06 +0100)]
avcodec/fft_template: Avoid useless function

ff_init_ff_cos_tabs is only used for the floating point FFT and only
if hardcoded tables are disabled.

Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoavfilter/drawutils: Remove remnants of old API
Andreas Rheinhardt [Thu, 28 Jan 2021 22:49:13 +0000 (23:49 +0100)]
avfilter/drawutils: Remove remnants of old API

ff_fill_line_with_color and ff_draw_rectangle are unused since
19c8f2271423281c9b876b984076a6467c455904; ff_copy_rectangle
is unused since 53b7a3fe081ec56c5706228eb6431bb943ad471a.

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoavfilter/vf_blackdetect: add support for >8 depth formats
Paul B Mahol [Fri, 29 Jan 2021 13:34:36 +0000 (14:34 +0100)]
avfilter/vf_blackdetect: add support for >8 depth formats

3 years agoavfilter/vf_blackdetect: fix bug when no final log would be displayed
Paul B Mahol [Fri, 29 Jan 2021 13:20:12 +0000 (14:20 +0100)]
avfilter/vf_blackdetect: fix bug when no final log would be displayed

3 years agoavfilter/vf_blackdetect: use the name 's' for the pointer to the private context
Paul B Mahol [Fri, 29 Jan 2021 13:14:14 +0000 (14:14 +0100)]
avfilter/vf_blackdetect: use the name 's' for the pointer to the private context

This is consistent across filters and also is less typing.

3 years agoavcodec/msmpeg4: Inline number of motion vectors
Andreas Rheinhardt [Tue, 26 Jan 2021 21:19:19 +0000 (22:19 +0100)]
avcodec/msmpeg4: Inline number of motion vectors

Both motion vector tables have the same number of elements, hence one
can inline said number and remove the field containing the number of
elements from the structure.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoavcodec/msmpeg4dec: Don't check for errors for complete VLCs
Andreas Rheinhardt [Tue, 26 Jan 2021 00:14:45 +0000 (01:14 +0100)]
avcodec/msmpeg4dec: Don't check for errors for complete VLCs

This also affected other users of VLCs from msmpeg4dec, namely vc1_block
and wmv2dec.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoavformat: Change avpriv_new_chapter() from O(n) to (1) in the common case
Michael Niedermayer [Wed, 6 Jan 2021 22:24:49 +0000 (23:24 +0100)]
avformat: Change avpriv_new_chapter() from O(n) to (1) in the common case

Fixes: timeout (slow -> 300ms)
Fixes: 28876/clusterfuzz-testcase-minimized-ffmpeg_dem_MOV_fuzzer-5664824587583488
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavformat/nuv: Check channels
Michael Niedermayer [Wed, 6 Jan 2021 22:42:39 +0000 (23:42 +0100)]
avformat/nuv: Check channels

Fixes: signed integer overflow: -3468545475927866368 * 4 cannot be represented in type 'long'
Fixes: 28879/clusterfuzz-testcase-minimized-ffmpeg_dem_NUV_fuzzer-6303367307591680
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavcodec/siren: Increase noise category 5 and 6
Michael Niedermayer [Thu, 24 Dec 2020 21:16:48 +0000 (22:16 +0100)]
avcodec/siren: Increase noise category 5 and 6

The entry read is not used in subsequent computation, thus its
value is not important.

Fixes: out of array read
Fixes: 28578/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SIREN_fuzzer-6332019122503680
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavcodec/siren: Factorize category 5 and 6 noise computation
Michael Niedermayer [Thu, 24 Dec 2020 21:13:56 +0000 (22:13 +0100)]
avcodec/siren: Factorize category 5 and 6 noise computation

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavcodec/siren: remove constant region_size
Michael Niedermayer [Thu, 24 Dec 2020 20:32:41 +0000 (21:32 +0100)]
avcodec/siren: remove constant region_size

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavformat/mpc8: Check size before implicitly converting to int
Michael Niedermayer [Thu, 24 Dec 2020 19:42:27 +0000 (20:42 +0100)]
avformat/mpc8: Check size before implicitly converting to int

Fixes: Timeout
Fixes: 28551/clusterfuzz-testcase-minimized-ffmpeg_dem_MPC8_fuzzer-6229183210586112
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agodoc/filters: mention commands support for pseudocolor
Paul B Mahol [Thu, 28 Jan 2021 19:54:58 +0000 (20:54 +0100)]
doc/filters: mention commands support for pseudocolor

3 years agoavfilter/vf_pseudocolor: add support for commands
Paul B Mahol [Thu, 28 Jan 2021 14:39:16 +0000 (15:39 +0100)]
avfilter/vf_pseudocolor: add support for commands

3 years agoavfilter/vf_pseudocolor: use macro for code that repeats
Paul B Mahol [Thu, 28 Jan 2021 14:30:57 +0000 (15:30 +0100)]
avfilter/vf_pseudocolor: use macro for code that repeats

3 years agoavfilter/vf_pseudocolor: add presets
Paul B Mahol [Thu, 28 Jan 2021 14:13:58 +0000 (15:13 +0100)]
avfilter/vf_pseudocolor: add presets

3 years agoavcodec/xbmenc: Allow for making UW images
Jose Da Silva [Tue, 19 Jan 2021 05:43:13 +0000 (21:43 -0800)]
avcodec/xbmenc: Allow for making UW images

I've run into some bugs where I was downloading a bunch of data and began
seeing weird hiccups. For example, javascript promises to allow you to push
some very long lines of data, but the hiccups I saw was with data larger
than 2k in length (windows) pushed out of a child process stdout piped into
the stdin of the calling parent program.
Soo much for smooth promises, this was broken and would run into similar
problems on a linux PC with 32k line limits.
The solution was to break the data into smaller chunks than 2k - and then
these data hiccups disappeared (windows PC).

It would be expected to be similar for linux PCs (32k I think) and other
OSes with different sizes.

If the ANSI required minimum needs to be 509 chars or larger (assuming
509+<CR>+<LF>+<0>=512), then 509 was chosen as the shortest worst-case
scenario) in this patch.
Most small pictures will go output looking pretty much the same data out
until you get to about 84bytes (672 pixels wide), where lines out begin to
be split. For example a UW 4K will exceed a 2k readln and a UW 10K picture
approaches an 8k readln

The purpose for this patch is to ensure that data remains below the
readline limits (of 509 chars), so that programs (like javascript) can push
data in large chunks without breaking into hiccups because the data length
is too long to be pushed cleanly in one go.
Subject: [PATCH 3/3] avcodec/xbmenc: Allow for making UW images

Worst-case ANSI must allow for 509 chars, while Windows allows for 2048
and Linux for 32K line length. This allows an OS with a small readline
access limitation to fetch very wide images (created from ffmpeg).

3 years agoavcodec/xbmenc: xbm Lower memory use
Jose Da Silva [Tue, 19 Jan 2021 05:43:05 +0000 (21:43 -0800)]
avcodec/xbmenc: xbm Lower memory use

Two minor memory improvements.

First bug reduces memory needed to about 6/7 the needed amount, which
allows you to host almost 7 pictures in the same memory needed for 6
Second is a recalculation of the total additional memory for headers etc.

size = avctx->height x (linesize * 6 + 1) + (31+32+38+4+1)
Subject: [PATCH 2/3] avcodec/xbmenc: xbm Lower memory use

Small 6/7th size memory reduction.
size = avctx->height x (linesize * 6 + 1) + (31+32+38+4+1)

Signed-off-by: Joe Da Silva <digital@joescat.com>
3 years agoavcodec/xbmenc: Do not add last comma into output
Jose Da Silva [Tue, 19 Jan 2021 05:42:57 +0000 (21:42 -0800)]
avcodec/xbmenc: Do not add last comma into output

There is a minor bug in xbm encode which adds a trailing comma at the end
of data. This isn't a big problem, but it would be nicer to be more
technically true to an array of data (by not including the last comma).

This bug fixes the output from something like this (having 4 values):
static unsigned char image_bits[] = { 0x00, 0x11, 0x22, }
to C code that looks like this instead (having 3 values):
static unsigned char image_bits[] = { 0x00, 0x11, 0x22 }
which is the intended results.
Subject: [PATCH 1/3] avcodec/xbmenc: Do not add last comma into output array

xbm outputs c arrays of data.
Including a comma at the end means there is another value to be added.
This bug fix changes something like this:
static unsigned char image_bits[] = { 0x00, 0x11, 0x22, }
to C code like this:
static unsigned char image_bits[] = { 0x00, 0x11, 0x22 }

Signed-off-by: Joe Da Silva <digital@joescat.com>
3 years agoavcodec/flashsv2enc: Fix use of uninitialized value
Andreas Rheinhardt [Wed, 27 Jan 2021 11:24:33 +0000 (12:24 +0100)]
avcodec/flashsv2enc: Fix use of uninitialized value

Before 257a83b969157eb76c18158a4e503e908d8b1125, certain buffers were
zero-allocated in the init function and only reallocated lateron if they
turned out to be too small; now they are only allocated during init,
leading to use-of-uninitialized values lateron. The same could happen
before if the dimensions are big enough so that the buffers would be
reallocated, as the new part of the reallocated buffer would not be
zeroed (happened for 960x960). So always zero the buffers in the
function designed to init them.

Reviewed-by: Marton Balint <cus@passwd.hu>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agodnn_backend_openvino.c: remove extra semicolon
Guo, Yejun [Tue, 26 Jan 2021 00:22:27 +0000 (08:22 +0800)]
dnn_backend_openvino.c: remove extra semicolon

3 years agodnn: remove type cast which is not necessary
Guo, Yejun [Fri, 22 Jan 2021 14:20:15 +0000 (22:20 +0800)]
dnn: remove type cast which is not necessary

3 years agotests/dnn: enable unit test dense
Guo, Yejun [Fri, 22 Jan 2021 13:44:14 +0000 (21:44 +0800)]
tests/dnn: enable unit test dense

3 years agoavfilter/vf_pseudocolor: add slice threading
Paul B Mahol [Wed, 27 Jan 2021 23:54:51 +0000 (00:54 +0100)]
avfilter/vf_pseudocolor: add slice threading

3 years agoavformat/mxfenc: add Coding Equations and Color Primaries to local tags
Marton Balint [Mon, 25 Jan 2021 21:04:05 +0000 (22:04 +0100)]
avformat/mxfenc: add Coding Equations and Color Primaries to local tags

Fixes ticket #9079.

Signed-off-by: Marton Balint <cus@passwd.hu>
3 years agoavcodec/h261dec: Make VLC smaller
Andreas Rheinhardt [Tue, 29 Dec 2020 21:09:10 +0000 (22:09 +0100)]
avcodec/h261dec: Make VLC smaller

The VLC for the macroblock address increment uses nine bits;
yet there is no code with this length: All codes are either shorter or
longer. So one can make the table smaller without changing the amount of
codes that need more than one round of parsing.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoRevert "mpeg4videodec: raise an error if sprite_trajectory.table is NULL"
Andreas Rheinhardt [Sat, 23 Jan 2021 16:52:52 +0000 (17:52 +0100)]
Revert "mpeg4videodec: raise an error if sprite_trajectory.table is NULL"

This reverts commit 6ac0e7818399a57e4684202bac79f35b3561ad1e.

The mpeg4video parser can reach code that presumes that a certain VLC
has been initialized; yet Libav did not ensure this and Libav bug #1012
[1] is about an ensuing crash.

Instead of fixing the root cause a simple check for whether said VLC
has already been initialized was added; said check is inherently racy.

The proper fix is of course to ensure that the VLC is initialized and
commit 7c76eaeca2791261d3f4f5c98c95f44abdbd879a already ensured this,
so there was no need to merge 6ac0e7818399a57e4684202bac79f35b3561ad1e
at all. This commit therefore reverts said commit.

[1]: https://bugzilla.libav.org/show_bug.cgi?id=1012

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoavformat/url: Reorder elements of URLProtocol to make it smaller
Andreas Rheinhardt [Sun, 24 Jan 2021 11:19:03 +0000 (12:19 +0100)]
avformat/url: Reorder elements of URLProtocol to make it smaller

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoavformat/avidec: Simplify compile-time check for DV demuxer
Andreas Rheinhardt [Tue, 26 Jan 2021 13:18:11 +0000 (14:18 +0100)]
avformat/avidec: Simplify compile-time check for DV demuxer

1b373b41d940e3058cdfb3d17703e23ed665353c made it a bit harder to find
out that a call to avpriv_dv_produce_packet is dead when the DV demuxer
is disabled; too hard for GCC on -O0. So simplify the check a bit.

Reviewed-by: Peter Ross <pross@xvid.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoavfilter: add colortemperature filter
Paul B Mahol [Mon, 25 Jan 2021 19:22:14 +0000 (20:22 +0100)]
avfilter: add colortemperature filter

3 years agoavfilter: add kirsch video filter
Paul B Mahol [Sat, 23 Jan 2021 13:54:51 +0000 (14:54 +0100)]
avfilter: add kirsch video filter

3 years agodoc/filters: mention that shear filter supports commands
Paul B Mahol [Wed, 27 Jan 2021 10:40:05 +0000 (11:40 +0100)]
doc/filters: mention that shear filter supports commands

3 years agolibavutil/frame.h: correct typo for AVFilmGrainParams in comment
Guo, Yejun [Wed, 27 Jan 2021 05:13:12 +0000 (13:13 +0800)]
libavutil/frame.h: correct typo for AVFilmGrainParams in comment

3 years agoavcodec/sei: add Parameter Sets Inclusion Indication enum value
James Almer [Fri, 22 Jan 2021 19:30:51 +0000 (16:30 -0300)]
avcodec/sei: add Parameter Sets Inclusion Indication enum value

Defined in H.274, it shares the same value as Active Parameter Sets from the
H.265 spec.

Signed-off-by: James Almer <jamrial@gmail.com>
3 years agoavfilter/vf_colorchannelmixer: extend pl option functionality
Paul B Mahol [Tue, 26 Jan 2021 23:33:56 +0000 (00:33 +0100)]
avfilter/vf_colorchannelmixer: extend pl option functionality

3 years agoavfilter/vf_lenscorrection: remove unused elements
Paul B Mahol [Tue, 26 Jan 2021 19:05:01 +0000 (20:05 +0100)]
avfilter/vf_lenscorrection: remove unused elements

3 years agoavfilter/vf_lenscorrection: reduce overhead calling execute for every plane
Paul B Mahol [Tue, 26 Jan 2021 19:02:41 +0000 (20:02 +0100)]
avfilter/vf_lenscorrection: reduce overhead calling execute for every plane

3 years agoavfilter/vf_lenscorrection: add support for commands
Paul B Mahol [Tue, 26 Jan 2021 18:43:03 +0000 (19:43 +0100)]
avfilter/vf_lenscorrection: add support for commands

3 years agoavcodec/cri: Fix whitespace issue in unpack_10bit()
Michael Niedermayer [Tue, 26 Jan 2021 18:52:10 +0000 (19:52 +0100)]
avcodec/cri: Fix whitespace issue in unpack_10bit()

Found-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavformat/realtextdec: Avoid undefined overflow in the end of read_ts()
Michael Niedermayer [Sat, 16 Jan 2021 22:37:41 +0000 (23:37 +0100)]
avformat/realtextdec: Avoid undefined overflow in the end of read_ts()

Fixes: signed integer overflow: 234080282628234040 * 100 cannot be represented in type 'long long'
Fixes: 26910/clusterfuzz-testcase-minimized-ffmpeg_dem_REALTEXT_fuzzer-6649867065753600
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavformat/nutdec: Fix integer overflow in count computation
Michael Niedermayer [Sat, 16 Jan 2021 21:44:33 +0000 (22:44 +0100)]
avformat/nutdec: Fix integer overflow in count computation

Note, the value is checked a few lines later already

Fixes: signed integer overflow: -440402016 - 1879048064 cannot be represented in type 'int'
Fixes: 26910/clusterfuzz-testcase-minimized-ffmpeg_dem_NUT_fuzzer-6603876618469376
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavformat/mvi: Use 64bit for testing dimensions
Michael Niedermayer [Sat, 16 Jan 2021 21:20:37 +0000 (22:20 +0100)]
avformat/mvi: Use 64bit for testing dimensions

Fixes: signed integer overflow: 65535 * 65535 cannot be represented in type 'int'
Fixes: 26910/clusterfuzz-testcase-minimized-ffmpeg_dem_MVI_fuzzer-6649291124899840
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavformat/utils: Check dts in update_initial_timestamps() more
Michael Niedermayer [Sat, 16 Jan 2021 21:05:53 +0000 (22:05 +0100)]
avformat/utils: Check dts in update_initial_timestamps() more

Fixes: signed integer overflow: -9223372036853488158 - 90000000 cannot be represented in type 'long long'
Fixes: 26910/clusterfuzz-testcase-minimized-ffmpeg_dem_MPSUB_fuzzer-6696625298866176
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavformat/mpsubdec: Use av_sat_add/sub64() in fracval handling
Michael Niedermayer [Sat, 16 Jan 2021 20:48:57 +0000 (21:48 +0100)]
avformat/mpsubdec: Use av_sat_add/sub64() in fracval handling

Fixes: signed integer overflow: 9223372036850000000 + 9000000 cannot be represented in type 'long long'
Fixes: 26910/clusterfuzz-testcase-minimized-ffmpeg_dem_MPSUB_fuzzer-665448017480908
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavformat/flvdec: Check for avio_read() failure in amf_get_string()
Michael Niedermayer [Tue, 26 Jan 2021 16:41:28 +0000 (17:41 +0100)]
avformat/flvdec: Check for avio_read() failure in amf_get_string()

Suggested-by: Anton Khirnov <anton@khirnov.net>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavformat/flvdec: Check for nesting depth in amf_skip_tag()
Michael Niedermayer [Sat, 23 Jan 2021 21:00:40 +0000 (22:00 +0100)]
avformat/flvdec: Check for nesting depth in amf_skip_tag()

Fixes: out of array access
Fixes: 29440/clusterfuzz-testcase-minimized-ffmpeg_dem_KUX_fuzzer-5985279812960256.fuzz
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavformat/flvdec: Check for nesting depth in amf_parse_object()
Michael Niedermayer [Sat, 23 Jan 2021 20:20:57 +0000 (21:20 +0100)]
avformat/flvdec: Check for nesting depth in amf_parse_object()

Fixes: out of array access
Fixes: 29202/clusterfuzz-testcase-minimized-ffmpeg_dem_KUX_fuzzer-5112845840809984
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavcodec/apedec: Use FFABSU() in do_apply_filter()
Michael Niedermayer [Wed, 20 Jan 2021 23:07:46 +0000 (00:07 +0100)]
avcodec/apedec: Use FFABSU() in do_apply_filter()

Fixes: negation of -2147483648 cannot be represented in type 'int'; cast to an unsigned type to negate this value to itself
Fixes: 29053/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_APE_fuzzer-4814432697974784
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Anton Khirnov <anton@khirnov.net>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavutil/common: Add FFABSU() for a signed -> unsigned ABS
Michael Niedermayer [Sat, 23 Jan 2021 15:22:33 +0000 (16:22 +0100)]
avutil/common: Add FFABSU() for a signed -> unsigned ABS

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavfilter/vf_unsharp: Remove unnecessary ;
Andreas Rheinhardt [Sun, 24 Jan 2021 21:26:06 +0000 (22:26 +0100)]
avfilter/vf_unsharp: Remove unnecessary ;

A macro that expands to a function definition might look like a
declaration, but it isn't and therefore an extra ';' at the end is
unnecessary and actually invalid (both GCC and Clang warn about this
when using -pedantic).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agolavc: shedule old encoding/decoding API for removal
Anton Khirnov [Mon, 25 Jan 2021 11:03:44 +0000 (12:03 +0100)]
lavc: shedule old encoding/decoding API for removal

It has been deprecated for 4 years and certain new codecs do not work
with it.

Also include AVCodecContext.refcounted_frames, as it has no effect with
the new API.

3 years agolavc/decode: move unrefcount_frame() right before its only caller
Anton Khirnov [Mon, 25 Jan 2021 10:55:32 +0000 (11:55 +0100)]
lavc/decode: move unrefcount_frame() right before its only caller

Will make wrapping it in deprecation guards simpler.

3 years agotools/target_dec_fuzzer: use non-obsolete decoding API
Anton Khirnov [Sat, 12 Dec 2020 15:38:10 +0000 (16:38 +0100)]
tools/target_dec_fuzzer: use non-obsolete decoding API

3 years agoavcodec/mpeg4videodec: Fix indentation
Andreas Rheinhardt [Sat, 23 Jan 2021 16:24:33 +0000 (17:24 +0100)]
avcodec/mpeg4videodec: Fix indentation

It was wrong since e03bf251d8784f4d1df2c22381c902087e151e31.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoavcodec/mpeg4videodec: Move code around to avoid forward declaration
Andreas Rheinhardt [Sat, 23 Jan 2021 16:19:00 +0000 (17:19 +0100)]
avcodec/mpeg4videodec: Move code around to avoid forward declaration

Also fix the indentation of decode_studio_vol_header while at it;
it was wrong since 177133a0f4b41b3c98b9cbc7f8f45755412c537b.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoavcodec/sp5x: Remove unused quant tables
Andreas Rheinhardt [Sat, 23 Jan 2021 15:54:51 +0000 (16:54 +0100)]
avcodec/sp5x: Remove unused quant tables

Only the fifth one is used.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoavcodec/exif: Avoid allocation for small buffer
Andreas Rheinhardt [Sat, 23 Jan 2021 14:44:50 +0000 (15:44 +0100)]
avcodec/exif: Avoid allocation for small buffer

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>