summaryrefslogtreecommitdiff
path: root/libavcodec
Commit message (Collapse)AuthorAge
* lavc/aacdec_template: Fix 7.1 decoding with default strictness.KM2021-02-16
| | | | | Broken in 4d9b9c5e Fixes ticket #9057.
* avcodec/frame_thread_encoder: Use more natural typesAndreas Rheinhardt2021-02-16
| | | | | Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/frame_thread_encoder: Reduce amount of code guarded by mutexAndreas Rheinhardt2021-02-16
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/frame_thread_encoder: Avoid FIFOAndreas Rheinhardt2021-02-16
| | | | | | It can be replaced by a simple counter. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/frame_thread_encoder: Avoid allocations of AVFramesAndreas Rheinhardt2021-02-16
| | | | | | | | | | | | | | | | Up until now, when using frame threaded encoding, an AVFrame would be allocated for every frame to be encoded. These AVFrames would reach the worker threads via a FIFO of tasks, a structure which contained the AVFrame as well as an index into an array which gives the place where the worker thread shall put the returned packet; in addition to that, said structure also contained several unused fields. This commit changes this: The AVFrames are now allocated during init in the array that is up until now only used to return the packets. The contents to be encoded are put into the AVFrame in the same array element that is also used to return the packets. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/frame_thread_encoder: Avoid creating reference to frameAndreas Rheinhardt2021-02-16
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/frame_thread_encoder: Avoid allocations of AVPackets, fix deadlockAndreas Rheinhardt2021-02-16
| | | | | | | | | | | | | | | | | | | | | Up until now, when doing frame thread encoding, each worker thread tried to allocate an AVPacket for every AVFrame to be encoded; said packets would then be handed back to the main thread, where the content of said packet is copied into the packet actually destined for output; the temporary AVPacket is then freed. Besides being wasteful this also has another problem: There is a risk of deadlock, namely if no AVPacket can be allocated at all. The user doesn't get an error at all in this case and the worker threads will simply try to allocate a packet again and again. If the user has supplied enough frames, the user's thread will block until a task has been completed, which just doesn't happen if no packet can ever be allocated. This patch instead modifies the code to allocate the packets during init; they are then reused again and again. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/frame_thread_encoder: Fix segfault on allocation errorAndreas Rheinhardt2021-02-16
| | | | | | | | | | | Fixes a segfault from av_fifo_size(NULL) that happens in ff_frame_thread_encoder_free if the fifo couldn't be allocted; furthermore the mutexes and conditions that are destroyed in ff_frame_thread_encoder_free are not even initialized at this point, so don't call said function. Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/frame_thread_encoder: Improve type safetyAndreas Rheinhardt2021-02-16
| | | | | Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/vp8: Move end check into MB loop in vp78_decode_mv_mb_modes()Michael Niedermayer2021-02-16
| | | | | | | | | Fixes: Timeout (long -> 5sec) Fixes: 30269/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_VP7_fuzzer-5430325004075008 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>
* avcodec/exr: export any unknown header string variable to metadataPaul B Mahol2021-02-16
| | | | And properly skip preview type in header.
* avcodec/exr: refactor GetByteContext usagePaul B Mahol2021-02-16
|
* avcodec/exr: correctly calculate display windowPaul B Mahol2021-02-16
|
* avcodec/exr: add multipart supportPaul B Mahol2021-02-16
|
* avcodec/setts_bsf: add sample rate for expressionsPaul B Mahol2021-02-15
|
* avcodec/exr: unbreak parsing sample aspect ratioPaul B Mahol2021-02-15
|
* avcodec/exr: read fps from metadata tooPaul B Mahol2021-02-15
|
* lavc/pnm: Allow decoding gray float pfm images.Carl Eugen Hoyos2021-02-15
|
* avcodec/fmvc: avoid copying uninitialized dataMichael Niedermayer2021-02-14
| | | | | | | | Fixes: Timeout Fixes: 30049/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_FMVC_fuzzer-5986909455253504 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/fits: Check gcount and pcount being non negativeMichael Niedermayer2021-02-14
| | | | | | | | Fixes: signed integer overflow: 9223372036854775807 - -30069403896 cannot be represented in type 'long' Fixes: 30046/clusterfuzz-testcase-minimized-ffmpeg_dem_FITS_fuzzer-5807144773484544 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/apedec: export bits_per_raw_samplePaul B Mahol2021-02-14
| | | | Fixes #4717
* avcodec/pngenc: remove monowhite from apng formatsPaul B Mahol2021-02-14
| | | | | | | Monowhite pixel format is not supported, and it does not make sense to add support for it. Fixes #7989
* avcodec/mediacodecdec: do not abort when H264/HEVC extradata extraction failssfan52021-02-14
| | | | | | | Although rare, extradata can be present but empty and extraction will fail. However Android also supports passing codec-specific data inline and will likely play such a stream anyway. So there's no reason to abort initialization before we know for sure.
* avcodec/pngdec: fix possible race condition with APNG decodingPaul B Mahol2021-02-13
| | | | Fixes #9017
* avcodec/pnm_parser: Check av_image_get_buffer_size() for failureMichael Niedermayer2021-02-12
| | | | | | | | | | Fixes: out of array access Fixes: 30135/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_PBM_fuzzer-4997145650397184 Fixes: 30208/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_PGMYUV_fuzzer-5605891665690624.fuzz 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/dpx: add support for other single component 8bit filesPaul B Mahol2021-02-12
|
* avcodec/dpx: add float support for single components and rgb(a)Paul B Mahol2021-02-12
|
* avcodec: add setts bitstream filterPaul B Mahol2021-02-12
|
* avcodec/hevcdec: fix a return error valueJames Almer2021-02-12
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/hevcdec: add some missing allocation checksJames Almer2021-02-11
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/hevcdec: check that the local context list was allocated before ↵James Almer2021-02-11
| | | | | | | | | | | | | | | | | | | dereferencing it Since the decoder is not flagged as init cleanup capable, hevc_decode_free() is being called manually if the hevc_decode_extradata() call fails at the end of hevc_decode_init(). In a frame threading scenario, however, if AVCodec->init() returns an error, ff_frame_thread_free() will be called regardless of the above flag being set or not, resulting in hevc_decode_free() being called a second time for the same context. Workaround this by ensuring pointers are not dereferenced if they are NULL, and set the decoder as init cleanup capable while at it. Fixes ticket #9099. Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/mpegvideo_motion: Remove unnecessary headersAndreas Rheinhardt2021-02-11
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/mpegvideo_motion: ReindentationAndreas Rheinhardt2021-02-11
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/mpegvideo_motion: Improve check to remove dead codeAndreas Rheinhardt2021-02-11
| | | | | | | | Several compile-time checks can be improved because mcsel is not used for MPEG-1/2 (it is only used for MPEG-4) and because MPEG-1/2 is the only user of ff_mpv_motion that uses MV_TYPE_16X8 and MV_TYPE_DMV. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/jpeg2000dec: Check atom_size in jp2_find_codestream()Michael Niedermayer2021-02-10
| | | | | | | | Fixes: Infinite loop Fixes: 29722/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_JPEG2000_fuzzer-6412228041506816 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/mobiclip: Bound planar prediction valueMichael Niedermayer2021-02-10
| | | | | | | | | Fixes: signed integer overflow: 2 * 1073741952 cannot be represented in type 'int' Fixes: 26765/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MOBICLIP_fuzzer-6594926936326144 Fixes: 29663/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MOBICLIP_fuzzer-5169789012148224 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/jpeglsdec: Fix k=16 in ls_get_code_regular()Michael Niedermayer2021-02-10
| | | | | | | | | | Fixes: Timeout Fixes: left shift of 33046 by 16 places cannot be represented in type 'int' Fixes: 29258/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MJPEG_fuzzer-4889231489105920 Fixes: 29515/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MJPEG_fuzzer-6161940391002112 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/hevc_sei: Check payload size in decode_nal_sei_message()Michael Niedermayer2021-02-10
| | | | | | | | Fixes: out of array access Fixes: 29392/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_HEVC_fuzzer-4821602850177024.fuzz Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/libaomenc: add support for setting arbitrary libaom optionsBohan Li2021-02-10
| | | | | | | | | A new key & value API lets us gain access to newly added parameters without adding explicit support for them in our wrapper. Add an option utilizing this functionality in a similar manner to other encoder libraries' wrappers. Signed-off-by: Bohan Li <bohanli@google.com>
* avcodec/fitsdec: properly initialize header->data_maxPaul B Mahol2021-02-10
|
* avcodec: add cri parserPaul B Mahol2021-02-09
|
* avcodec/argo: fix linesize for RLE? in PAL8 modePaul B Mahol2021-02-09
|
* avcodec/g722enc: Validate parameters before using themAndreas Rheinhardt2021-02-08
| | | | | | | | In case trellis is outside of 0..23, an invalid shift and/or a signed integer overflow happens; furthermore, it can lead to the request to allocate nonsense amounts of memory. So validate first. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* mjpegdec: stop setting the QP tableAnton Khirnov2021-02-08
| | | | | | | MJPEG does not have a single quantiser scale, so this does not fit into the intended API use. This removes the last use of the long-deprecated QP table API.
* avcodec/ac3enc: Share options and defaultsAndreas Rheinhardt2021-02-07
| | | | | | | | | | Both AC-3 encoder share the same options, yet they are nevertheless duplicated in the binary; and the options applying to the EAC-3 encoder are a proper subset of the options for the AC-3 encoders, so that it can use the same options as the former by putting the options specific to AC-3 at the front. This commit implements this. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/Makefile: Remove dependency for nonexistent filesAndreas Rheinhardt2021-02-07
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/aacdec_fixed: Move fixed-point sinewin tables to its only userAndreas Rheinhardt2021-02-07
| | | | | | | | | | | | | | | | | | | | | | The fixed-point AAC decoder is the only user of the fixed-point sinewin tables from sinewin; and it only uses a few of them (about 10% when counting by size). This means that guarding initializing these tables by an AVOnce (as done in 3719122065863f701026632f610175980d42b05a) is unnecessary for them. Furthermore the array of pointers to the individual arrays is also unneeded. Therefore this commit moves these tables directly into aacdec_fixed.c; this is done by ridding the original sinewin.h and sinewin_tablegen.h headers completely of any fixed-point code at the cost of a bit of duplicated code (the alternative is an ugly ifdef-mess). This saves about 58KB from the binary when using hardcoded tables (as these tables are hardcoded in this scenario); when not using hardcoded tables, most of these savings only affect the .bss segment, but the rest (< 1KB) contains relocations (i.e. savings in .data.rel.ro). Reviewed-by: Lynne <dev@lynne.ee> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/xbm_parser: mark frame as intra only and as key framePaul B Mahol2021-02-05
|
* avcodec/xbm_parser: split long linePaul B Mahol2021-02-05
|
* avcodec: add xbm parserPaul B Mahol2021-02-05
|