summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAge
* avcodec/vp6: return value check for av_malloczJiasheng Jiang2022-02-11
| | | | | | | | | | | | As the potential failure of the av_mallocz(), the 's->alpha_context' could be NULL and be dereferenced later. Therefore, it should be better to check it and deal with it if fails in order to prevent memory leak, same as the av_frame_alloc() in ff_vp56_init(). Fixes: 39a3894ad5 ("lavc/vp6: Implement "slice" threading for VP6A decode") Reviewed-by: Peter Ross <pross@xvid.org> Signed-off-by: Jiasheng Jiang <jiasheng@iscas.ac.cn>
* avformat/mpegts: initialize max_packet_size when sub-demuxerGyan Doshi2022-02-10
| | | | | | | | | | | bca30570d2 added a user option to set max_packet_size replacing a hardcoded value. This had a side-effect of leaving the field set to 0 when packet demuxing is carried out from another demuxer using avpriv functions, which could lead to demux failure. Hardcoded max_packet_size inside avpriv_mpegts_parse_open to 2048000 to avoid this. Value chosen to be 10x that of default value to accommodate large payloads.
* avfilter/vf_avgblur: fix memory leaks if config_input() is called againPaul B Mahol2022-02-10
|
* avfilter/vf_dblur: fix memory leaks if config_input() is called againPaul B Mahol2022-02-10
|
* avfilter/vf_gblur: fix memory leaks if config_input() is called againPaul B Mahol2022-02-10
|
* avfilter/vf_gblur: use av_freep()Paul B Mahol2022-02-10
|
* avcodec/pthread_frame: Properly unref frame in case of decoding failureAndreas Rheinhardt2022-02-09
| | | | | | | | | | Use ff_thread_release_buffer() instead of av_frame_unref(), as the former handles the case of non-thread-safe callbacks properly. (This is possible now that ff_thread_release_buffer() no longer requires a ThreadFrame.) Reviewed-by: Anton Khirnov <anton@khirnov.net> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/thread: Don't use ThreadFrame when unnecessaryAndreas Rheinhardt2022-02-09
| | | | | | | | | | | | | | | | | | | | | | | The majority of frame-threaded decoders (mainly the intra-only) need exactly one part of ThreadFrame: The AVFrame. They don't need the owners nor the progress, yet they had to use it because ff_thread_(get|release)_buffer() requires it. This commit changes this and makes these functions work with ordinary AVFrames; the decoders that need the extra fields for progress use ff_thread_(get|release)_ext_buffer() which work exactly as ff_thread_(get|release)_buffer() used to do. This also avoids some unnecessary allocations of progress AVBuffers, namely for H.264 and HEVC film grain frames: These frames are not used for synchronization and therefore don't need a ThreadFrame. Also move the ThreadFrame structure as well as ff_thread_ref_frame() to threadframe.h, the header for frame-threaded decoders with inter-frame dependencies. Reviewed-by: Anton Khirnov <anton@khirnov.net> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/threadframe: Add ff_thread_(get|release)_ext_buffer()Andreas Rheinhardt2022-02-09
| | | | | | | | | These will be used by the codecs that need allocated progress and is in preparation for no longer using ThreadFrame by the codecs that don't. Reviewed-by: Anton Khirnov <anton@khirnov.net> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/thread: Move ff_thread_(await|report)_progress to new headerAndreas Rheinhardt2022-02-09
| | | | | | | | | | This is in preparation for further commits that will stop using ThreadFrame for frame-threaded codecs that don't use ff_thread_(await|report)_progress(); the API for those codecs having inter-frame depdendencies will live in threadframe.h. Reviewed-by: Anton Khirnov <anton@khirnov.net> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/hapdec: Remove always-false checkAndreas Rheinhardt2022-02-09
| | | | | Reviewed-by: Anton Khirnov <anton@khirnov.net> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/pthread_frame: Don't prematurily presume frame-threadingAndreas Rheinhardt2022-02-09
| | | | | | | | | | | Several of our decoders support both frame- as well as slice-threading; in case of the latter avctx->internal->thread_ctx points to a SliceThreadContext, not to a frame-thread PerThreadContext. So only treat avctx->internal->thread_ctx as the latter after having checked that frame-threading is active. Reviewed-by: Anton Khirnov <anton@khirnov.net> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/motion_est: fix indention of ff_get_best_fcode()Michael Niedermayer2022-02-09
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/motion_est: Fix xy indexing on range violation in ff_get_best_fcode()Michael Niedermayer2022-02-09
| | | | | | | This codepath seems untested, no testcases change Found-by: <mkver> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/hls: Use unsigned for iv computationMichael Niedermayer2022-02-09
| | | | | | | | | Fixes: signed integer overflow: 9223372036854775748 + 60 cannot be represented in type 'long' Fixes: 44417/clusterfuzz-testcase-minimized-ffmpeg_dem_HLS_fuzzer-5802443881971712 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>
* avcodec/jpeglsdec: Increase range for N in ls_get_code_runterm() by using ↵Michael Niedermayer2022-02-09
| | | | | | | | | | | | unsigned Fixes: left shift of 32768 by 16 places cannot be represented in type 'int' Fixes: Timeout Fixes: 44219/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SMVJPEG_fuzzer-4679455379947520 Fixes: 44088/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SMVJPEG_fuzzer-4885976600674304 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/matroskadec: Check desc_bytesMichael Niedermayer2022-02-09
| | | | | | | | Fixes: Division by 0 Fixes: 44035/clusterfuzz-testcase-minimized-ffmpeg_dem_WEBM_DASH_MANIFEST_fuzzer-4826721386364928 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/utils: Fix invalid NULL pointer operation in ff_parse_key_value()Michael Niedermayer2022-02-09
| | | | | | | | Fixes: pointer index expression with base 0x000000000000 overflowed to 0xffffffffffffffff Fixes: 44012/clusterfuzz-testcase-minimized-ffmpeg_dem_HLS_fuzzer-5670607746891776 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/matroskadec: Fix infinite loop with bz decompressionMichael Niedermayer2022-02-09
| | | | | | | | | | | The same check is added to zlib too, it seems not needed there though Fixes: Infinite loop Fixes: 43932/clusterfuzz-testcase-minimized-ffmpeg_dem_MATROSKA_fuzzer-6175167573786624 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>
* avformat/utils: keep chapter monotonicity on chapter updatesMichael Niedermayer2022-02-09
| | | | | | | | | Updating a chapter with the same id does not break monotonicity Fixes: Timeout Fixes: 43727/clusterfuzz-testcase-minimized-ffmpeg_dem_MOV_fuzzer-4960623367159808 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* lavfi/qsvpp: fix after 85c938fa28Anton Khirnov2022-02-09
|
* avcodec/vp8: Remove always-false checkAndreas Rheinhardt2022-02-09
| | | | | | | | | | Since e9b66175793e5c2af19beefe8e143f6e4901b5df a codec's close function is never ever called for a codec whose init function has not been called; in particular, it is never ever called if the AVCodecContext's private data has not been allocated. Reviewed-by: Peter Ross <pross@xvid.org> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/hcadec: Mark decoder as init-threadsafeAndreas Rheinhardt2022-02-09
| | | | | Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/hcadec: Fix memleak upon allocation errorAndreas Rheinhardt2022-02-09
| | | | | | | An AVFloatDSPContext would leak upon av_tx_init() failure. Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/hls: Implement support for using AVSEEK_FLAG_BACKWARD when seekingGustav Grusell2022-02-09
| | | | | | | | | Before, seeking in hls streams would always seek to the next keyframe after the given timestamp. With this fix, if seeking in videostream and AVSEEK_FLAG_BACKWARD is set, seeking will be to the first keyframe of the segment containing the given timestamp. This fixes #7485. Signed-off-by: Gustav Grusell <gustav.grusell@gmail.com>
* lavu/fifo: fix regressionHaihao Xiang2022-02-09
| | | | | | | | | | | offset_w might be updated after growing the FIFO Fix ticket #9630 Tested-by: U. Artie Eoff <ullysses.a.eoff@intel.com> Reviewed-by: mkver Reviewed-by: U. Artie Eoff <ullysses.a.eoff@intel.com> Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
* libavutil: include assembly with full path from source rootAlexander Kanavin2022-02-08
| | | | | | | | Otherwise nasm writes the full host-specific paths into .o output, which breaks binary reproducibility. Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> Signed-off-by: Anton Khirnov <anton@khirnov.net>
* avcodec/cbs_mpeg2: Use smaller scope for variablesAndreas Rheinhardt2022-02-08
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/internal.h: Move avpriv_find_start_code() to startcode.hAndreas Rheinhardt2022-02-08
| | | | | | | | This is by definition the appropriate place for it. Remove all the now unnecessary libavcodec/internal.h inclusions; also remove other unnecessary headers from the affected files. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* all: Remove unnecessary libavcodec/internal.h inclusionsAndreas Rheinhardt2022-02-08
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/cbs_mpeg2: Simplify splitting fragmentAndreas Rheinhardt2022-02-08
| | | | | | | | | | | | | | | | | | | | | | avpriv_find_start_code() supports non-contiguous buffers by maintaining a state that allows to find start codes that span across multiple buffers; a consequence thereof is that avpriv_find_start_code() is given a zero-sized buffer, it does not modify this state, so that it appears as if a start code was found if the state contained a start code. This can e.g. happen with Sequence End units in MPEG-2 and to counter this, cbs_mpeg2_split_fragment() reset the state when it has already encountered the end of the fragment in order to add the last unit (if it is only of the form 00 00 01 xy) only once; it also used a flag to set whether this is the final unit. Yet this can be improved by simply resetting state unconditionally (thereby avoiding a branch); the flag can be removed by just checking whether we have a valid start code (of the next unit to add) at the end. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/cbs: Make ff_cbs_insert_unit_data() always append the new unitAndreas Rheinhardt2022-02-08
| | | | | | | All split functions (the only users of this function) only append units. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/cbs_jpeg: Remove redundant counterAndreas Rheinhardt2022-02-08
| | | | | | | | | | Use -1 as the position in ff_cbs_insert_unit_data() which implicitly reuses frag->nb_units as the counter. Also switch to a do-while-loop, as it is more natural than a for-loop now that the counter is gone. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/cbs_mpeg2: Remove redundant counterAndreas Rheinhardt2022-02-08
| | | | | | | | | | Use -1 as the position in ff_cbs_insert_unit_data() which implicitly reuses frag->nb_units as the counter. Also switch to a do-while-loop, as it is more natural than a for-loop now that the counter is gone. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avutil: use getauxval(3) for CPU capabilities on linux/android ARMAman Karmani2022-02-07
| | | | | | | | | | getauxval is marginally faster, and works even when procfs is not mounted support on Linux was added in glibc 2.16 support on Android was added in 4.4 (API 20) fixes #6578 Signed-off-by: Aman Karmani <aman@tmm1.net>
* lavu/tx: wrap missed string in NULL_IF_CONFIG_SMALLLynne2022-02-07
| | | | It's the only one that isn't defined through the macros used elsewhere.
* lavu/tx: disable debugging information when CONFIG_SMALLLynne2022-02-07
|
* lavu/tx: refactor assembly codelet definitionLynne2022-02-07
| | | | | | | | | | | This commit does some refactoring to make defining assembly codelets smaller, and fixes compiler redefinition warnings. It also allows for other assembly versions to reuse the same boilerplate code as x86. Finally, it also adds the out_of_place flag to all assembly codelets. This changes nothing, as out-of-place operation was assumed to be available anyway, but this makes it more explicit.
* avutil/fifo: Deprecate old FIFO APIAnton Khirnov2022-02-07
| | | | | | | | Users should switch to the superior AVFifo API. Unfortunately AVFifoBuffer fields cannot be marked as deprecated because it would trigger a warning wherever fifo.h is #included, due to inlined av_fifo_peek2().
* ffmpeg: switch to new FIFO APIAnton Khirnov2022-02-07
|
* ffplay: switch to new FIFO APIAnton Khirnov2022-02-07
|
* lavfi/vf_deshake_opencl: switch to new FIFO APIAnton Khirnov2022-02-07
|
* lavfi/qsvvpp: switch to new FIFO APIAnton Khirnov2022-02-07
|
* lavu/threadmessage: switch to new FIFO APIAnton Khirnov2022-02-07
|
* lavu/audio_fifo: switch to new FIFO APIAnton Khirnov2022-02-07
|
* lavu/audio_fifo: drop an unnecessary includeAnton Khirnov2022-02-07
| | | | Nothing in audio_fifo.h uses anything from fifo.h
* lavd/jack: switch to the new FIFO APIAnton Khirnov2022-02-07
|
* lavf/async: switch to new FIFO APIAnton Khirnov2022-02-07
|
* lavf/udp: switch to new FIFO APIAnton Khirnov2022-02-07
|
* lavf/swfenc: switch to new FIFO APIAnton Khirnov2022-02-07
|