Commit Graph

100866 Commits

Author SHA1 Message Date
Michael Niedermayer 78d6d8ddb5 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>
2021-01-28 21:06:48 +01:00
Paul B Mahol ed51890191 doc/filters: mention commands support for pseudocolor 2021-01-28 20:56:16 +01:00
Paul B Mahol 61a0ff892e avfilter/vf_pseudocolor: add support for commands 2021-01-28 20:07:37 +01:00
Paul B Mahol 891da955af avfilter/vf_pseudocolor: use macro for code that repeats 2021-01-28 20:07:37 +01:00
Paul B Mahol d01aa49753 avfilter/vf_pseudocolor: add presets 2021-01-28 20:07:37 +01:00
Jose Da Silva c31a7d07f6 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).
2021-01-28 15:50:37 +01:00
Jose Da Silva cb70e1921a 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>
2021-01-28 15:50:25 +01:00
Jose Da Silva 41b8fd3a16 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>
2021-01-28 15:50:09 +01:00
Andreas Rheinhardt 9267e2ff0d avcodec/flashsv2enc: Fix use of uninitialized value
Before 257a83b969, 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>
2021-01-28 13:59:00 +01:00
Guo, Yejun eccc7971c2 dnn_backend_openvino.c: remove extra semicolon 2021-01-28 09:45:13 +08:00
Guo, Yejun 06c01f1763 dnn: remove type cast which is not necessary 2021-01-28 09:45:13 +08:00
Guo, Yejun a163aa6cf7 tests/dnn: enable unit test dense 2021-01-28 09:45:13 +08:00
Paul B Mahol 24892fa4a7 avfilter/vf_pseudocolor: add slice threading 2021-01-28 01:00:22 +01:00
Marton Balint b410b14fba avformat/mxfenc: add Coding Equations and Color Primaries to local tags
Fixes ticket #9079.

Signed-off-by: Marton Balint <cus@passwd.hu>
2021-01-27 23:43:19 +01:00
Andreas Rheinhardt 9f38fac053 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>
2021-01-27 11:53:22 +01:00
Andreas Rheinhardt ba96f2254a Revert "mpeg4videodec: raise an error if sprite_trajectory.table is NULL"
This reverts commit 6ac0e78183.

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 7c76eaeca2 already ensured this,
so there was no need to merge 6ac0e78183
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>
2021-01-27 11:53:22 +01:00
Andreas Rheinhardt e1cba568f2 avformat/url: Reorder elements of URLProtocol to make it smaller
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2021-01-27 11:53:22 +01:00
Andreas Rheinhardt d64d30bd25 avformat/avidec: Simplify compile-time check for DV demuxer
1b373b41d9 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>
2021-01-27 11:53:22 +01:00
Paul B Mahol a9d23d33a1 avfilter: add colortemperature filter 2021-01-27 11:48:00 +01:00
Paul B Mahol 35f8628047 avfilter: add kirsch video filter 2021-01-27 11:46:26 +01:00
Paul B Mahol 021dc4f107 doc/filters: mention that shear filter supports commands 2021-01-27 11:45:31 +01:00
Guo, Yejun 149bfc2445 libavutil/frame.h: correct typo for AVFilmGrainParams in comment 2021-01-27 13:13:47 +08:00
James Almer 683cd25c5a 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>
2021-01-26 21:27:29 -03:00
Paul B Mahol 2ee2e4cd41 avfilter/vf_colorchannelmixer: extend pl option functionality 2021-01-27 00:57:26 +01:00
Paul B Mahol 199d9e705a avfilter/vf_lenscorrection: remove unused elements 2021-01-26 20:08:05 +01:00
Paul B Mahol 499c3193a5 avfilter/vf_lenscorrection: reduce overhead calling execute for every plane 2021-01-26 20:08:05 +01:00
Paul B Mahol 46f170e544 avfilter/vf_lenscorrection: add support for commands 2021-01-26 20:08:05 +01:00
Michael Niedermayer 33f6d8e376 avcodec/cri: Fix whitespace issue in unpack_10bit()
Found-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-01-26 19:52:59 +01:00
Michael Niedermayer aa1b8e6898 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>
2021-01-26 18:37:12 +01:00
Michael Niedermayer 0014249fd9 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>
2021-01-26 18:37:12 +01:00
Michael Niedermayer 48fb752767 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>
2021-01-26 18:37:12 +01:00
Michael Niedermayer 29851cb840 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>
2021-01-26 18:37:12 +01:00
Michael Niedermayer 463e024363 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>
2021-01-26 18:37:12 +01:00
Michael Niedermayer cb31667611 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>
2021-01-26 18:37:12 +01:00
Michael Niedermayer 2ef522c918 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>
2021-01-26 18:37:12 +01:00
Michael Niedermayer 074e204b42 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>
2021-01-26 18:37:12 +01:00
Michael Niedermayer 59a6becf8e 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>
2021-01-26 18:37:12 +01:00
Michael Niedermayer 5dd9567080 avutil/common: Add FFABSU() for a signed -> unsigned ABS
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-01-26 18:37:12 +01:00
Andreas Rheinhardt 3c700c82cb 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>
2021-01-26 17:44:41 +01:00
Anton Khirnov 9e30859cb6 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.
2021-01-26 17:05:58 +01:00
Anton Khirnov 25f4304ebb lavc/decode: move unrefcount_frame() right before its only caller
Will make wrapping it in deprecation guards simpler.
2021-01-26 17:05:49 +01:00
Anton Khirnov da99b4c878 tools/target_dec_fuzzer: use non-obsolete decoding API 2021-01-26 17:04:45 +01:00
Andreas Rheinhardt 2490ac635c avcodec/mpeg4videodec: Fix indentation
It was wrong since e03bf251d8.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2021-01-26 13:57:00 +01:00
Andreas Rheinhardt f410febddc 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 177133a0f4.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2021-01-26 13:57:00 +01:00
Andreas Rheinhardt d9f5bd15fd avcodec/sp5x: Remove unused quant tables
Only the fifth one is used.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2021-01-26 13:57:00 +01:00
Andreas Rheinhardt f15477169e avcodec/exif: Avoid allocation for small buffer
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2021-01-26 13:56:59 +01:00
Andreas Rheinhardt 458acb61fa avcodec/amrnbdata: Remove unused array
Always unused.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2021-01-26 13:56:59 +01:00
Andreas Rheinhardt edfdcb0487 avcodec/ilbcdata: Remove unused array
Never used.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2021-01-26 13:56:59 +01:00
Andreas Rheinhardt 2668caf13c avcodec/atrac3plus_data: Remove unused arrays
Forgotten in 58fc810d42.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2021-01-26 13:56:59 +01:00
Andreas Rheinhardt 10d059bb24 avcodec/dnxhd: Make ff_dxnhd_get_cid_table return a pointer, not index
All callers only use the index into ff_dnxhd_cid_table to get a pointer
to the desired entry.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2021-01-26 13:56:59 +01:00