summaryrefslogtreecommitdiff
path: root/libavcodec
Commit message (Collapse)AuthorAge
* avcodec/omx: Remove remnants of old preallocated buffersAndreas Rheinhardt2021-06-08
| | | | | | | | | There are no preallocated buffer packets any more; this feature only worked with the old encode API and only until said API was turned into a wrapper for the new API in 93016f5d1d280f9cb7856883af287fa66affc04c. So remove its remnants. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/dvenc: Avoid copying packet data, allow user-supplied buffersAndreas Rheinhardt2021-06-08
| | | | | | | | | | | | When the packet size is known in advance like here, one can avoid an intermediate buffer for the packet data; this also makes it easy to allow user-supplied buffers. Only one thing needed to be changed: The earlier code relied on the buffer having been initially zeroed by av_fast_padded_malloc(), so one now needs to zero the packet at first. Reviewed-by: James Almer <jamrial@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/nvenc: add option to disable all extra SEI dataTimo Rothenpieler2021-06-06
| | | | | | | | | | | With these triggering a lot of crashes recently, an option to globally disable all of them is added as a tool to work around those crashes in case the SEI data is not needed by the user. Also re-enables s12m for hevc_nvenc, since the issue is not specifically with that, but it affects all SEI data. Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
* avcodec/nvenc: extract sei data prep into own functionTimo Rothenpieler2021-06-04
|
* avcodec/nvenc: write out user data unregistered SEIBrad Hards2021-06-04
| | | | | Signed-off-by: Brad Hards <bradh@frogmouth.net> Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
* avcodec/nvenc: use persistent sei data bufferBrad Hards2021-06-04
| | | | | Signed-off-by: Brad Hards <bradh@frogmouth.net> Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
* libavcodec/mips: Fix fate errors reported by clangJin Bo2021-06-03
| | | | | | | | The data width of gsldrc1/gsldlc1 should be 8 bytes wide. Signed-off-by: Jin Bo <jinbo@loongson.cn> Reviewed-by: yinshiyou-hf@loongson.cn Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* libavcodec/mips: Fix build errors reported by clangJin Bo2021-06-03
| | | | | | | | | | Clang is more strict on the type of asm operands, float or double type variable should use constraint 'f', integer variable should use constraint 'r'. Signed-off-by: Jin Bo <jinbo@loongson.cn> Reviewed-by: yinshiyou-hf@loongson.cn Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/jpeglsdec: force pal8 only onceMichael Niedermayer2021-06-02
| | | | | | | | | | | Fixes: Infinite loop Fixes: 33958/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_THP_fuzzer-6590264069193728 Fixes: 33981/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_JPEGLS_fuzzer-5343224173559808 Fixes: 33986/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MJPEG_fuzzer-6598815122587648 Fixes: 34001/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SMVJPEG_fuzzer-6171098111672320 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: Fix order of condition for pal8Michael Niedermayer2021-06-02
| | | | | | | | | Fixes: out of array access Fixes: 33960/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_THP_fuzzer-5052852809629696 Fixes: 34163/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_THP_fuzzer-6123678099177472 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/mpegvideo_enc: Reset stuffing bits if they are not supportedMichael Niedermayer2021-06-02
| | | | | | | Fixes: Assertion failure Fixes: Ticket8202 Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/svq1enc: Do not print debug RD value before it has been computedMichael Niedermayer2021-06-02
| | | | | | | | Avoids floating point division by 0 Fixes: Ticket8191 Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/aacpsy: Check bandwidthMichael Niedermayer2021-06-02
| | | | | | Fixes: Ticket8011 Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/aacenc: Do not divide by lambda_count if it is 0Michael Niedermayer2021-06-02
| | | | | | | | Avoids Floating point division by 0 Fixes: Ticket8011 Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/aacenc: Use FLT_EPSILON for lambda minimumMichael Niedermayer2021-06-02
|
* avcodec/nvenc: disable s12m timestamps by defaultTimo Rothenpieler2021-05-29
| | | | | Leads to weird crashes with valid looking input data for otherwise unknown reasons.
* avcodec/lpc: Avoid floating point division by 0Michael Niedermayer2021-05-29
| | | | | | | Fixes: Ticket7996 Fixes: CVE-2020-20445 Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/aacpsy: Avoid floating point division by 0 of norm_facMichael Niedermayer2021-05-29
| | | | | | | Fixes: Ticket7995 Fixes: CVE-2020-20446 Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/aacenc: Avoid 0 lambdaMichael Niedermayer2021-05-29
| | | | | | | Fixes: Ticket8003 Fixes: CVE-2020-20453 Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* libavcodec/mips: Fix specification of instruction nameJin Bo2021-05-28
| | | | | | | | | | | 1.'xor,or,and' to 'pxor,por,pand'. In the case of operating FPR, gcc supports both of them, clang only supports the second type. 2.'dsrl,srl' to 'ssrld,ssrlw'. In the case of operating FPR, gcc supports both of them, clang only supports the second type. Signed-off-by: Jin Bo <jinbo@loongson.cn> Reviewed-by: yinshiyou-hf@loongson.cn Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/exr: More strictly check dc_countMichael Niedermayer2021-05-27
| | | | | | | | Fixes: out of array access Fixes: exr/deneme Found-by: Burak Çarıkçı <burakcarikci@crypttech.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/exr: x/ymax cannot be INT_MAXMichael Niedermayer2021-05-27
| | | | | | | | | | The code uses x/ymax + 1 so the maximum is INT_MAX-1 Fixes: signed integer overflow: 2147483647 + 1 cannot be represented in type 'int' Fixes: 33158/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_EXR_fuzzer-5545462457303040 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/error_resilience: cleanup mpeg2 handlingMichael Niedermayer2021-05-27
| | | | | | After this, the loop for the mpeg2 case is only executed when needed Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/utils: don't use ff_fast_mallocz() in av_fast_padded_malloc()James Almer2021-05-27
| | | | | | It will be removed in the next commit. Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/libxavs2: Allow user-supplied buffersAndreas Rheinhardt2021-05-23
| | | | | | | | Here the packet size is known before allocating the packet, so that supporting user-supplied buffers is trivial. Reviewed-by: James Almer <jamrial@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/sbcenc: Avoid copying packet data, allow user-supplied buffersAndreas Rheinhardt2021-05-23
| | | | | | | | | When the packet size is known in advance like here, one can avoid an intermediate buffer for the packet data by using ff_get_encode_buffer() and also set AV_CODEC_CAP_DR1 at the same time. Reviewed-by: James Almer <jamrial@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/pngenc: Avoid copying APNG data, allow user-supplied bufferAndreas Rheinhardt2021-05-23
| | | | | | | | | | The APNG encoder already uses internal buffers, so that the packet size is already known before allocating the packet; therefore one can avoid another (implicit) intermediate buffer by switching to ff_get_encode_buffer(), thereby also supporting user-supplied buffers. Reviewed-by: James Almer <jamrial@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/pngenc: Remove always-true checkAndreas Rheinhardt2021-05-23
| | | | | Reviewed-by: James Almer <jamrial@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/flacenc: Avoid copying packet data, allow user-supplied buffersAndreas Rheinhardt2021-05-23
| | | | | | | | | The FLAC encoder calculates the size in advance, so one can avoid an intermediate buffer for the packet data by using ff_get_encode_buffer() and also set AV_CODEC_CAP_DR1 at the same time. Reviewed-by: James Almer <jamrial@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/pamenc: Avoid copying packet data, allow user-supplied buffersAndreas Rheinhardt2021-05-23
| | | | | | | | | When the packet size is known in advance like here, one can avoid an intermediate buffer for the packet data by using ff_get_encode_buffer() and also set AV_CODEC_CAP_DR1 at the same time. Reviewed-by: James Almer <jamrial@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/pnmenc: Avoid intermediate buffer, allow user-supplied buffersAndreas Rheinhardt2021-05-23
| | | | | | | | | | | For all p*m encoders a very sharp upper bound for the size of the output packets is available before the packet is allocated. This can be used to avoid an intermediate buffer when encoding by using ff_get_encode_buffer() instead of ff_alloc_packet2() (without min_size); this also adds support for user-supplied buffers. Reviewed-by: James Almer <jamrial@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/libxavs: Improve returned error codesAndreas Rheinhardt2021-05-23
| | | | | Reviewed-by: James Almer <jamrial@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/libxavs: Avoid overallocating, copying packet dataAndreas Rheinhardt2021-05-23
| | | | | | | | | | | When the packet size is known in advance like here, one can avoid an intermediate buffer for the packet data; also, there is no reason to add AV_INPUT_BUFFER_MIN_SIZE to the packet size any more, as the actually needed packet size can be easily calculated: It is three bytes more than the raw nal size per NALU. Reviewed-by: James Almer <jamrial@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/libx265: Allow user-supplied buffersAndreas Rheinhardt2021-05-23
| | | | | | | | Here the packet size is known before allocating the packet, so that supporting user-supplied buffers is trivial. Reviewed-by: James Almer <jamrial@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/libx264: Avoid copying data, allow user-supplied buffersAndreas Rheinhardt2021-05-23
| | | | | | | | | | | Here the packet size is known before allocating the packet because the encoder provides said information (and works with internal buffers itself), so one can use this information to avoid the implicit use of another intermediate buffer for the packet data; and by switching to ff_get_encode_buffer() one can also allow user-supplied buffers. Reviewed-by: James Almer <jamrial@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/libwebpenc_animencoder: Allow user-supplied buffersAndreas Rheinhardt2021-05-23
| | | | | | | | Here the packet size is known before allocating the packet, so that supporting user-supplied buffers is trivial. Reviewed-by: James Almer <jamrial@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/libwebpenc: Allow user-supplied buffersAndreas Rheinhardt2021-05-23
| | | | | | | | Here the packet size is known before allocating the packet, so that supporting user-supplied buffers is trivial. Reviewed-by: James Almer <jamrial@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/libvpxenc: Avoid one level of indentationAndreas Rheinhardt2021-05-23
| | | | | | Reviewed-by: James Almer <jamrial@gmail.com> Reviewed-by: James Zern <jzern@google.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/libvpxenc: Avoid copying data, allow user-supplied buffersAndreas Rheinhardt2021-05-23
| | | | | | | | | | | | Here the packet size is known before allocating the packet because the encoder provides said information (and works with internal buffers itself), so one can use this information to avoid the implicit use of another intermediate buffer for the packet data; and by switching to ff_get_encode_buffer() one can also allow user-supplied buffers. Reviewed-by: James Almer <jamrial@gmail.com> Reviewed-by: James Zern <jzern@google.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/libvorbisenc: Avoid copying data, allow user-supplied buffersAndreas Rheinhardt2021-05-23
| | | | | | | | | | | Here the packet size is known before allocating the packet because the encoder provides said information (and works with internal buffers itself), so one can use this information to avoid the implicit use of another intermediate buffer for the packet data; and by switching to ff_get_encode_buffer() one can also allow user-supplied buffers. Reviewed-by: James Almer <jamrial@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/libtheoraenc: Avoid copying data, allow user-supplied buffersAndreas Rheinhardt2021-05-23
| | | | | | | | | | | Here the packet size is known before allocating the packet because the encoder provides said information (and works with internal buffers itself), so one can use this information to avoid the implicit use of another intermediate buffer for the packet data; and by switching to ff_get_encode_buffer() one can also allow user-supplied buffers. Reviewed-by: James Almer <jamrial@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/libshine: Avoid copying data, allow user-supplied bufferAndreas Rheinhardt2021-05-23
| | | | | | | | | | | The libshine encoder already uses an internal buffer, so that the packet size is already known before allocating the packet; therefore one can avoid another (implicit) intermediate buffer by switching to ff_get_encode_buffer(), thereby also supporting user-supplied buffers. Reviewed-by: James Almer <jamrial@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/libopenh264enc: Allow user-supplied buffersAndreas Rheinhardt2021-05-23
| | | | | | | | Here the packet size is known before allocating the packet, so that supporting user-supplied buffers is trivial. Reviewed-by: James Almer <jamrial@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/libmp3lame: Avoid copying data, allow user-supplied bufferAndreas Rheinhardt2021-05-23
| | | | | | | | | | | The libmp3lame encoder already uses an internal buffer, so that the packet size is already known before allocating the packet; therefore one can avoid another (implicit) intermediate buffer by switching to ff_get_encode_buffer(), thereby also supporting user-supplied buffers. Reviewed-by: James Almer <jamrial@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/libkvazaar: Allow user-supplied buffersAndreas Rheinhardt2021-05-23
| | | | | | | | Here the packet size is known before allocating the packet, so that supporting user-supplied buffers is trivial. Reviewed-by: James Almer <jamrial@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/libgsmenc: Avoid copying packet data, allow user-supplied buffersAndreas Rheinhardt2021-05-23
| | | | | | | | | When the packet size is known in advance like here, one can avoid an intermediate buffer for the packet data by using ff_get_encode_buffer() and also set AV_CODEC_CAP_DR1 at the same time. Reviewed-by: James Almer <jamrial@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/libcodec2: Avoid copying packet data, allow user-supplied buffersAndreas Rheinhardt2021-05-23
| | | | | | | | | When the packet size is known in advance like here, one can avoid an intermediate buffer for the packet data by using ff_get_encode_buffer() and also set AV_CODEC_CAP_DR1 at the same time. Reviewed-by: James Almer <jamrial@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/libaomenc: Avoid copying data, allow user-supplied buffersAndreas Rheinhardt2021-05-23
| | | | | | | | | | | | Here the packet size is known before allocating the packet because the encoder provides said information (and works with internal buffers itself), so one can use this information to avoid the implicit use of another intermediate buffer for the packet data; and by switching to ff_get_encode_buffer() one can also allow user-supplied buffers. Reviewed-by: James Almer <jamrial@gmail.com> Reviewed-by: James Zern <jzern@google.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/audiotoolboxenc: Remove AV_CODEC_CAP_DR1Andreas Rheinhardt2021-05-23
| | | | | | | | | It has been added in 2016 when this flag made no sense for encoders at all; now that it makes sense, audiotoolboxenc doesn't support it, despite claiming to do so. Reviewed-by: James Almer <jamrial@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* aarch64: hevc_idct: Fix overflows in idct_dcMartin Storsjö2021-05-22
| | | | | | | | This is marginally slower, but correct for all input values. The previous implementation failed with certain input seeds, e.g. "checkasm --test=hevc_idct 98". Signed-off-by: Martin Storsjö <martin@martin.st>