summaryrefslogtreecommitdiff
path: root/libavcodec
Commit message (Collapse)AuthorAge
* avcodec/mlpenc: remove log messages when allocation fails at initPaul B Mahol2021-09-04
|
* avcodec/mlpenc: allocate filter buffers once at initPaul B Mahol2021-09-04
|
* avcodec/mlpenc: simplify allocations in mlp_encode_init()Paul B Mahol2021-09-04
|
* avcodec/omx: ReindentationAndreas Rheinhardt2021-09-04
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/omx: Check initializing mutexes/conditionsAndreas Rheinhardt2021-09-04
| | | | | | | | | | | | | The earlier code did not properly check these initializations: It only recorded whether the part of init where these initializations are has been reached, but it did not check whether the initializations were successful, although destroying them would be undefined behaviour if they had not been initialized successfully. Furthermore cleanup() always locked a mutex regardless of whether there was any attempt to initialize these mutexes at all. Reviewed-by: Martin Storsjö <martin@martin.st> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/frame_thread_encoder: Mark init and free functions as av_coldAndreas Rheinhardt2021-09-04
| | | | | Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/frame_thread_encoder: Return proper error codesAndreas Rheinhardt2021-09-04
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/frame_thread_encoder: Don't shadow variablesAndreas Rheinhardt2021-09-04
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/frame_thread_encoder: Reindent after the previous commitAndreas Rheinhardt2021-09-04
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/frame_thread_encoder: Check initializing mutexes/conditionsAndreas Rheinhardt2021-09-04
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/vp9: Remove vp9_free_entries()Andreas Rheinhardt2021-09-04
| | | | | | | | | | | Now that the mutexes and conditions are only initialized and destroyed once, said function only had one purpose: free the entries array. Given that vp9_alloc_entries() already does this if the array is already allocated it is unnecessary to call vp9_free_entries() anywhere except when closing. And then one can just inline the one free into vp9_decode_free(). Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/vp9: Use av_freep() instead of av_free()Andreas Rheinhardt2021-09-04
| | | | | | | | Otherwise the context would be in an inconsistent state if vp9_alloc_entries() failed (and if this would be checked). Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/vp9: Don't free buffer known to be NULLAndreas Rheinhardt2021-09-04
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/vp9: Check initializing conditions/mutexesAndreas Rheinhardt2021-09-04
| | | | | | Also don't destroy uninitialized conditions/mutexes. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/pthread_frame: Move (init|free)_pthread() to pthread.cAndreas Rheinhardt2021-09-04
| | | | | | | | We have more mutexes/condition variables whose initialization is unchecked. Also use a proper namespace for these functions. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/vp9: Do not destroy uninitialized mutexes/conditionsAndreas Rheinhardt2021-09-04
| | | | | | | | | | | | | | | | Also do not destroy and reinitialize mutexes and conditions when certain input parameters change. Given that the decoder did not create these variables at all during init, uninitialized mutexes and conditions are destroyed before the very first initialization. This is undefined behaviour and certain threading implementations like pthreadGC2 crash when it is attempted. Fix this by initializing these objects once during init and freeing them in close. Reported-by: Steve Lhomme <robux4@ycbcr.xyz> Reviewed-by: Steve Lhomme <robux4@ycbcr.xyz> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/h264_levels, h265_profile_level: Avoid relocationsAndreas Rheinhardt2021-09-04
| | | | | | | | | | | | | | H.264 and H.265 levels' names are usually of the form "x" or "x.y" with x and y being single digits; the one exception are the H.264 1b levels. All of those levels' names fit into a char[4] and it is likely that this future levels will do so, too. Therefore this commit changes the H26(4|5)LevelDescriptor structures to use such a char [4] instead of a pointer to a const char. This makes the structures smaller (when sizeof(char*) == 8) and avoids relocations, thereby moving the corresponding arrays from .data.rel.ro into .rodata. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/interplayacm: fix draining and last frame number of samplesPaul B Mahol2021-09-04
|
* avcodec/wmaprodec: unbreak old xma2 decodingPaul B Mahol2021-09-03
|
* avcodec/libdav1d: fix compilation after recent libdav1d API changesJames Almer2021-09-03
| | | | | | | | They were done in preparation for an upcoming 1.0 release. Keep supporting previous releases for the time being. Reviewed-by: BBB Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/wmaprodec: improve flushing for >2 channels in XMAPaul B Mahol2021-09-03
|
* avcodec/wmaprodec: improve xma2 extradata parsingPaul B Mahol2021-09-03
|
* avcodec/pnm_parser: add support for PFM parsingPaul B Mahol2021-09-03
|
* avcodec/wmaprodec: unbreak xma >2 channel decoding after last changePaul B Mahol2021-09-03
|
* avcodec/pictordec: Optimize more odd cases for picmemset()Michael Niedermayer2021-09-02
| | | | | | | | | Fixes: Timeout Fixes: 36875/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_PICTOR_fuzzer-4842960888922112 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Tested-by: Peter Ross <pross@xvid.org> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/avcodec: Allow up to seven codec ids per parserAndreas Rheinhardt2021-09-02
| | | | | | | ff_pnm_parser and ff_vp3_parser already hit the current limit; an addition to the former (to handle pfm) is planned. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/mlpenc: add support for 24bit encodingPaul B Mahol2021-09-02
|
* avcodec/wmaprodec: add gapless supportPaul B Mahol2021-09-02
|
* avcodec/libx265: add support for setting chroma sample locationJan Ekström2021-09-01
| | | | | | | Unlike libx264, libx265 does not handle the chroma format check on its own side, so in order to not write out values which are supposed to be ignored according to the specification, we limit the writing out of chroma sample location to 4:2:0 only.
* avcodec/mlpdec: reset lossless crc checking when stream endsPaul B Mahol2021-08-31
| | | | | | | | Fixes invalid reports of bad lossless crc. While here make end of stream message into debug level as it is not really important to user. Also wait for new major sync frame as invalid concating of files may produce invalid files, which cause various errors.
* avcodec/mlpenc: fix encoding last samples when not within full intervalPaul B Mahol2021-08-31
| | | | Also implement shorten_by in bitstream.
* avcodec/tiff_common: Fix AVBPrint error checksAndreas Rheinhardt2021-08-30
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/libx265: only call av_pix_fmt_desc_get once in initJan Ekström2021-08-29
| | | | Now both current usages utilize an already found descriptor.
* avcodec/libx264: add support for setting chroma sample locationJan Ekström2021-08-29
|
* avcodec/mlpdec: add flush supportPaul B Mahol2021-08-29
| | | | Fixes spurious lossless check failures when seeking.
* avcodec/mjpegbdec: Skip SOS on AVDISCARD_ALL as does mjpegMichael Niedermayer2021-08-28
| | | | | | | | | | | Fixes: NULL pointer dereference Fixes: 36342/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MJPEGB_fuzzer-4579188072906752 Fixes: 36344/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MJPEGB_fuzzer-5049579300061184 Fixes: 36345/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MJPEGB_fuzzer-5301149845553152 Fixes: 36374/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MJPEGB_fuzzer-6056312352931840 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/mjpegdec: Check for bits left in mjpeg_decode_scan_progressive_ac()Michael Niedermayer2021-08-28
| | | | | | | | Fixes: Timeout Fixes: 36262/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_JPEGLS_fuzzer-4969052454912000 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/wmaprodec: return value check for init_get_bitsmaryam ebrahimzadeh2021-08-28
| | | | Also replace init_get_bits with init_get_bits8().
* h274: remove optimization pragmaLynne2021-08-28
| | | | | | | | | | | | | | This results in warnings on compilers which don't support it, objections were raised during the review process about it but went unnoticed, and the speed benefit is highly compiler and version specific, and also not very critical. We generally hand-write assembly to optimize loops like that, rather than use compiler magic, and for 40% best case scenario, it's simply not worth it. Plus, tree vectorization is still problematic with GCC and disabled by default for a good reason, so enabling it locally is sketchy.
* avcodec/vc1dec: return value check for init_get_bitsmaryam ebrahimzadeh2021-08-26
| | | | | | As the second argument for init_get_bits(avctx and buf) can be crafted, a return value check for this function call is necessary, so replace init_get_bits with init_get_bits8 and add return value check.
* avcodec/wmadec: handle run_level_decode errorStéphane Cerveau2021-08-26
| | | | | | | | | Consider data as invalid if ff_wma_run_level_decode gets out with an error. It avoids an unpleasant sound distorsion. See http://trac.ffmpeg.org/ticket/9358
* avcodec/wma: Return specific error codeOlivier Crête2021-08-26
| | | | | | | This way, the calling function can just forward it instead of making it up. Signed-off-by: Olivier Crête <olivier.crete@collabora.com>
* avcodec/vp6: return value check for init_get_bitsmaryam ebrahimzadeh2021-08-26
| | | | | | | | As the second argument for init_get_bits(buf) can be crafted, a return value check for this function call is necessary. Also replace init_get_bits with init_get_bits8. Signed-off-by: Peter Ross <pross@xvid.org>
* avcodec/bsf: Avoid allocation for AVBSFInternalAndreas Rheinhardt2021-08-25
| | | | | | | | | | Do this by allocating AVBSFContext together with the data that is currently in AVBSFInternal; or rather: Put AVBSFContext at the beginning of a new structure called FFBSFContext (which encompasses more than just the internal fields and is a proper context in its own right, hence the name) and remove the AVBSFInternal altogether. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/codec: Reorder elements to make AVCodec smallerAndreas Rheinhardt2021-08-25
| | | | | | Reordering max_lowres is an ABI break. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/h264_slice: don't allocate film grain buffers when using hwaccelJames Almer2021-08-25
| | | | | | Fixes regression since 66845cffc3bbb17f91294d15cd6f57f3df3bce97 Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/dnxhddec: ignore second flag for encoded fieldPaul B Mahol2021-08-25
| | | | | | And instead use previous field flag. Fixes decoding files produced by non-compliant encoders.
* arm: hevc_qpel: Fix the assembly to work with non-multiple of 8 widthsMartin Storsjö2021-08-25
| | | | | | | | | | | | | | | | | | | | This unbreaks the fate-checkasm-hevc_pel test on arm targets. The assembly assumed that the width passed to the DSP functions is a multiple of 8, while the checkasm test used other widths too. This wasn't noticed before, because the hevc_pel checkasm tests (that were added in 9c513edb7999a35ddcc6e3a8d984a96c8fb492a3 in January) weren't run as part of fate until in b492cacffd36ad4cb251ba1f13ac398318ee639a in August. As this hasn't been an issue in practice with actual full decoding tests, it seems like the actual decoder doesn't call these functions with such widths. Therefore, we could alternatively fix the test to only test things that the real decoder does, and this modification could be reverted. Signed-off-by: Martin Storsjö <martin@martin.st>
* avcodec/jpeg2000_parser: Fix skipping of JP2 info markers by correctly ↵Shaun Simpson2021-08-25
| | | | | | reading marker size Signed-off-by: Shaun Simpson <shauns2029@gmail.com>
* avcodec/jpeg2000_parser: Fix parsing of tile-part headerShaun Simpson2021-08-25
| | | | | | And frames where the end of frame marker is at the end of the buffer. Signed-off-by: Shaun Simpson <shauns2029@gmail.com>