summaryrefslogtreecommitdiff
path: root/libavcodec
Commit message (Collapse)AuthorAge
* avcodec/opus: always use ambisonic layout for mapping family 2James Almer2022-03-20
| | | | | | | | | | | 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>
* lavc/bsf: improve doxyAnton Khirnov2022-03-19
|
* lavc/bsf: add general documentationAnton Khirnov2022-03-19
| | | | Also, place the BSF api docs in their own doxygen group.
* avcodec/flashsv2enc: Avoid opening and closing z_streamAndreas Rheinhardt2022-03-19
| | | | | | Instead initialize a z_stream during init and reset it when needed. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/lclenc: Use ff_deflate_init/end() wrappersAndreas Rheinhardt2022-03-19
| | | | | | | | | They return nicer error messages on error; furthermore, they also use our allocation functions. It also stops calling deflateEnd() on a z_stream that might not have been successfully initialized. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/pngenc: Use ff_deflate_init/end() wrappersAndreas Rheinhardt2022-03-19
| | | | | | They return nicer error messages. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/zmbvenc: Use ff_deflate_init/end() wrappersAndreas Rheinhardt2022-03-19
| | | | | | | They emit better error messages (it does not claim that inflateInit failed upon an error from deflateInit!) and uses our allocation functions. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/zlib_wrapper: Add wrapper for deflateInit()Andreas Rheinhardt2022-03-19
| | | | | | | | | | | The rationale is the same as for the wrappers for inflateInit(), although the case for it is admittedly not so strong because there are less users of deflateInit(). Also remove an unnecessary inclusion of config.h in libavformat/protocols.c in order to trigger a request for reconfigure (which is needed for CONFIG_DEFLATE_WRAPPER to take effect). Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/pngenc: Don't use deflateInit2() with default parametersAndreas Rheinhardt2022-03-19
| | | | | | Use deflateInit() instead. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/pngdec: Don't open and close z_streams unnecessarilyAndreas Rheinhardt2022-03-19
| | | | | | | | Instead reuse and reset a single z_stream. Also use FFZStream in decode_zbuf(), because it has nicer error messages. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/lscrdec: Don't open and close z_streams unnecessarilyAndreas Rheinhardt2022-03-19
| | | | | | Instead reuse and reset a single z_stream. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/zlib_wrapper: Use our allocation, freeing functionsAndreas Rheinhardt2022-03-19
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/flashsv: Use ff_inflate_init/end()Andreas Rheinhardt2022-03-19
| | | | | | | This fixes the problem of potentially closing a z_stream that has never been successfully initialized. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/lcldec: Use ff_inflate_init/end(), cleanup genericallyAndreas Rheinhardt2022-03-19
| | | | | | | | | Returns better error messages in case of error and deduplicates the inflateInit() code and also allows to cleanup generically in case of errors as it is save to call ff_inflate_end() if ff_inflate_init() has not been called successfully. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/mscc: Use ff_inflate_init/end()Andreas Rheinhardt2022-03-19
| | | | | | | This fixes the problem of potentially closing a z_stream that has never been successfully initialized. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/mvha: Use ff_inflate_init/end()Andreas Rheinhardt2022-03-19
| | | | | | | This fixes the problem of potentially closing a z_stream that has never been successfully initialized. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/mwsc: Use ff_inflate_init/end()Andreas Rheinhardt2022-03-19
| | | | | | | This fixes the problem of potentially closing a z_stream that has never been successfully initialized. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/rasc: Use ff_inflate_init/end()Andreas Rheinhardt2022-03-19
| | | | | | | This fixes the problem of potentially closing a z_stream that has never been successfully initialized. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/tscc: Use ff_inflate_init/end()Andreas Rheinhardt2022-03-19
| | | | | | | Returns better error messages in case of error and deduplicates the inflateInit() code. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/wcmv: Use ff_inflate_init/end()Andreas Rheinhardt2022-03-19
| | | | | | | This fixes the problem of potentially closing a z_stream that has never been successfully initialized. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/zerocodec: Use ff_inflate_init/end()Andreas Rheinhardt2022-03-19
| | | | | | | This fixes the problem of potentially closing a z_stream that has never been successfully initialized. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/zmbv: Use ff_inflate_init/end()Andreas Rheinhardt2022-03-19
| | | | | | | Returns better error messages in case of error and deduplicates the inflateInit() code. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/zlib_wrapper: Add wrappers for zlib inflateInit, inflateEndAndreas Rheinhardt2022-03-19
| | | | | | | | | | | | | | | | | It is not documented to be safe to call inflateEnd() on a z_stream that has never been successfully been initialized by inflateInit(), but just zeroed. It just happens to work and several codecs rely on this (they have FF_CODEC_CAP_INIT_CLEANUP set and even call inflateEnd() when inflateInit() failed or has never been called). To avoid this, other codecs recorded whether their zstream has been initialized successfully or not. This commit adds wrappers for inflateInit() and inflateEnd() that do what these other codecs do; furthermore, they also take care of properly setting up the zstream before inflateInit() and emit an error message in case of error. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/pngenc: Avoid potentially truncating integersAndreas Rheinhardt2022-03-19
| | | | | | | | | So use 64bits for max_packet_size instead of size_t which might be 32 bits; this is consistent with ff_alloc_packet(). Also remove a redundant size check (ff_alloc_packet() already checks for that). Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* Keep including the full version.h when headers are included externallyMartin Storsjö2022-03-19
| | | | | | | | | This avoids unnecessary churn and build breakage for users, by making sure the whole version.h is included like it has been so far, while keeping the benefit of not needing to rebuild most files in the ffmpeg tree on minor/micro bumps. Signed-off-by: Martin Storsjö <martin@martin.st>
* avcodec/sonic: Use unsigned for predictor_k to avoid undefined behaviorMichael Niedermayer2022-03-18
| | | | | | | | Fixes: signed integer overflow: -1094995529 * 24 cannot be represented in type 'int' Fixes: 44436/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SONIC_fuzzer-4874459459223552 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/ccaption_dec: Use ff_ass_add_rect2()Michael Niedermayer2022-03-18
| | | | | | | | Fixes: Timeout Fixes: 42258/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_CCAPTION_fuzzer-5540144118104064 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/ass: Faster ff_ass_add_rect()Michael Niedermayer2022-03-18
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/setts_bsf: fix memleakZhao Zhili2022-03-18
| | | | | Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/alsdec: Set channels from data after data is setMichael Niedermayer2022-03-18
| | | | | | | | | | Fixes: out of array write Fixes: 45624/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ALS_fuzzer-6473487382872064 Fixes: 45626/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ALS_fuzzer-4874997192065024 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>
* avcodec/dfpwmdec: Check packet size more completelyMichael Niedermayer2022-03-18
| | | | | | | | | | Fixes: out of array access Fixes: 45497/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_DFPWM_fuzzer-5239786212818944.fuzz Fixes: 45510/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_DFPWM_fuzzer-4947856883056640 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>
* avcodec/libuavs3d: Check ff_set_dimensions() for failureMichael Niedermayer2022-03-17
| | | | | | Untested, no testcase Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/speexdec: Align some commentsMichael Niedermayer2022-03-17
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/speexdec: Use correct doxygen commentsMichael Niedermayer2022-03-17
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/dfa: Optimize output reshuffle loopMichael Niedermayer2022-03-17
| | | | | | 18035 -> 4018 dezicycles (Tested with LOGOS.DFA, gcc 7, 3950X) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/mjpegbdec: Set buf_sizeMichael Niedermayer2022-03-17
| | | | | | | | Fixes: Timeout Fixes: 45170/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MJPEGB_fuzzer-5874820431085568 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/setts_bsf: don't repeatedly set start pts and dtsJames Almer2022-03-17
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/setts_bsf: fix setting output timebaseJames Almer2022-03-16
| | | | | | | Set a valid max value for the option, and also check numerator before assuming the value is useful. Signed-off-by: James Almer <jamrial@gmail.com>
* configure: Use a separate config_components.h header for $ALL_COMPONENTSMartin Storsjö2022-03-16
| | | | | | | | This avoids unnecessary rebuilds of most source files if only the list of enabled components has changed, but not the other properties of the build, set in config.h. Signed-off-by: Martin Storsjö <martin@martin.st>
* doc: Add an entry to APIchanges about changes to version.h and version_major.hMartin Storsjö2022-03-16
| | | | | | | | Also bump the minor versions of all libraries, to signify the API change of splitting the version.h headers and adding the new version_major.h header. Signed-off-by: Martin Storsjö <martin@martin.st>
* libavcodec: Split version.hMartin Storsjö2022-03-16
| | | | | | | | | | | | | | This avoids including version.h in all source files, avoiding unnecessary rebuilds when the version number is bumped. Only version_major.h is included by the main header, which defines availability of e.g. FF_API_* macros, and which is bumped much less often. This isn't done for libavutil/version.h, because that header needs to be included essentially everywhere due to LIBAVUTIL_VERSION_INT being used wherever an AVClass is constructed. Signed-off-by: Martin Storsjö <martin@martin.st>
* avcodec/hevc_refs: don't use the frame's AVBufferRef sizes when initializing ↵James Almer2022-03-15
| | | | | | | | | planes Use the actual plane sizes instead. Reviewed-by: Anton Khirnov <anton@khirnov.net> Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/codec_par: do not copy AVChannelLayout struct directlyMarton Balint2022-03-15
| | | | | | | Later we use av_channel_layout_copy, but that uninits the struct unintentionally freeing the possibly allocated u.map pointer. Signed-off-by: Marton Balint <cus@passwd.hu>
* Bump minor versions after the channel layout changesJames Almer2022-03-15
| | | | | | Forgotten in the respective commits adding new API. Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/audiotoolboxenc: add missing AVCodec.ch_layoutsJames Almer2022-03-15
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/dca_lbr: set nchannelsJames Almer2022-03-15
| | | | | | Fixes warnings about uninitialized values Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/audiotoolboxenc: use the correct macros for standard channel layoutsJames Almer2022-03-15
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/audiotoolboxenc: Fix the use of FF_ARRAY_ELEMSMartin Storsjö2022-03-15
| | | | Signed-off-by: Martin Storsjö <martin@martin.st>
* avcodec/audiotoolboxenc: use the correct function nameJames Almer2022-03-15
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* opus: export mapping family 2 (Ambisonic) as Ambisonic layoutAnton Khirnov2022-03-15
| | | | Signed-off-by: James Almer <jamrial@gmail.com>