summaryrefslogtreecommitdiff
path: root/libavcodec/wavpack.c
Commit message (Collapse)AuthorAge
* avcodec: Constify AVCodecsAndreas Rheinhardt2021-04-27
| | | | | | | | | | Given that the AVCodec.next pointer has now been removed, most of the AVCodecs are not modified at all any more and can therefore be made const (as this patch does); the only exceptions are the very few codecs for external libraries that have a init_static_data callback. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec: set AV_CODEC_CAP_CHANNEL_CONF on decoders which set their own channelsHendrik Leppkes2020-12-10
| | | | | | | | | | | | The decoders in this set either have a fixed channel count, or read it from the bitstream, and thus do not require the channel count as external information. Fixes various regressions since 81503ac58a763a36b1f57264013b1e76acb62b68, which requires a valid channel count for decoders which do not set this capability. Signed-off-by: Hendrik Leppkes <h.leppkes@gmail.com>
* avcodec/dsd: Make initializing DSD tables thread-safeAndreas Rheinhardt2020-12-08
| | | | | | | This automatically makes the DSD formats as well as DST and WavPack init-threadsafe. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/wavpack: Fix leak on init failureAndreas Rheinhardt2020-12-08
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/wavpack: use av_buffer_replace() to simplify codeGil Pedersen2020-11-19
| | | | | | Reviewed-by: Anton Khirnov <anton@khirnov.net> Signed-off-by: Gil Pedersen <git@gpost.dk> Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/wavpack: Do not allow the sample format to change between channelsMichael Niedermayer2020-06-04
| | | | | | | | | | Fixes: out of array access Fixes: 22692/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_WAVPACK_fuzzer-5678686190960640 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Reviewed-by: David Bryant <david@wavpack.com> Tested-by: David Bryant <david@wavpack.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/wavpack: Check rate_x and sample rate for overflowMichael Niedermayer2020-05-05
| | | | | | | | | Fixes: shift exponent 32 is too large for 32-bit type 'int' Fixes: 21647/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_WAVPACK_fuzzer-5686168323883008 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Reviewed-by: David Bryant <david@wavpack.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* pthread_frame: merge the functionality for normal decoder init and ↵Anton Khirnov2020-04-10
| | | | | | | | | | | | | | | | init_thread_copy The current design, where - proper init is called for the first per-thread context - first thread's private data is copied into private data for all the other threads - a "fixup" function is called for all the other threads to e.g. allocate dynamically allocated data is very fragile and hard to follow, so it is abandoned. Instead, the same init function is used to init each per-thread context. Where necessary, AVCodecInternal.is_copy can be used to differentiate between the first thread and the other ones (e.g. for decoding the extradata just once).
* lavc: replace AVCodecInternal.allocate_progress with an internal capAnton Khirnov2020-04-10
| | | | This is a constant codec property, so a capability flag is more appropriate.
* wavpack: fully support stream parameter changesAnton Khirnov2020-04-10
| | | | Fix invalid memory access on DSD streams with changing channel count.
* avcodec/wavpack: check for allocation failurePaul B Mahol2020-03-11
|
* avcodec/wavpack: fix some syle issuesPaul B Mahol2020-03-11
|
* avcodec/wavpack: add support for DSD filesDavid Bryant2020-03-11
| | | | | | | | | | | | | | | | | Add support for WavPack DSD files to the existing WavPack decoder using avcodec/dsd to perform the 8:1 decimation to 32-bit float samples. We must serialize the dsd2pcm operation (cross-boundary filtering) but would like to use frame-level multithreading for the CPU-intensive DSD decompression, and this is accomplished with ff_thread_report/await_progress(). Because the dsd2pcm operation is independent across channels we use slice-based multithreading for that part. Also a few things were removed from the existing WavPack decoder that weren't being used (primarily the SavedContext stuff) and the WavPack demuxer was enhanced to correctly determine the sampling rate of DSD files (and of course to no longer reject them). Signed-off-by: David Bryant <david@wavpack.com>
* avcodec/wavpack: simplify the codeLimin Wang2020-01-11
| | | | | Signed-off-by: Limin Wang <lance.lmwang@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/wavpack: fix decoding of files with many channelsPaul B Mahol2018-12-28
| | | | Fixes decoding of Run_The_Race_-_3rd_Order_Ambisonic_SN3D.wv
* avcodec/wavpack: Fix overflow in adding tailMichael Niedermayer2018-06-11
| | | | | | | | Fixes: signed integer overflow: 2146907204 + 26846088 cannot be represented in type 'int' Fixes: 8105/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_WAVPACK_fuzzer-6233036682166272 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/wavpack: Fix integer overflow in wv_unpack_stereo()Michael Niedermayer2018-04-29
| | | | | | | | Fixes: runtime error: signed integer overflow: 2147483531 + 16384 cannot be represented in type 'int' Fixes: 6615/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_WAVPACK_fuzzer-5165715515506688 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/wavpack: Fix integer overflow in FFABSMichael Niedermayer2018-02-03
| | | | | | | | Fixes: negation of -2147483648 cannot be represented in type 'int'; cast to an unsigned type to negate this value to itself Fixes: 5396/clusterfuzz-testcase-minimized-6558555529281536 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/wavpack: Fix integer overflows in wv_unpack_stereo / monoMichael Niedermayer2018-01-15
| | | | | | | | Fixes: runtime error: signed integer overflow: 2146276249 + 1487583 cannot be represented in type 'int' Fixes: 4823/clusterfuzz-testcase-minimized-4551896611160064 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/wavpack: Fix invalid shiftMichael Niedermayer2017-07-05
| | | | | | | | Fixes: runtime error: left shift of 1 by 31 places cannot be represented in type 'int' Fixes: 2377/clusterfuzz-testcase-minimized-6108505935183872 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/wavpack: Fix integer overflow in wv_unpack_stereo()Michael Niedermayer2017-06-25
| | | | | | | | Fixes: runtime error: signed integer overflow: 2080374785 + 2080374784 cannot be represented in type 'int' Fixes: 2351/clusterfuzz-testcase-minimized-5359403240783872 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/wavpack: Fix integer overflowMichael Niedermayer2017-06-23
| | | | | | | | Fixes: runtime error: signed integer overflow: 227511904 + 1964113935 cannot be represented in type 'int' Fixes: 2331/clusterfuzz-testcase-minimized-6182185830711296 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/wavpack: Fix undefined integer negationMichael Niedermayer2017-06-19
| | | | | | | | Fixes: runtime error: negation of -2147483648 cannot be represented in type 'int'; cast to an unsigned type to negate this value to itself Fixes: 2291/clusterfuzz-testcase-minimized-5538453481586688 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/wavpack: Fix runtime error: signed integer overflow: 2081021665 - ↵Michael Niedermayer2017-06-04
| | | | | | | | | -130689706 cannot be represented in type 'int' Fixes: 2038/clusterfuzz-testcase-minimized-4521466148159488 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/wavpack: Fix runtime error: shift exponent 32 is too large for ↵Michael Niedermayer2017-06-01
| | | | | | | | | 32-bit type 'int' Fixes: 1967/clusterfuzz-testcase-minimized-5757031199801344 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/wavpack: Fix runtime error: signed integer overflow: 2013265955 - ↵Michael Niedermayer2017-05-31
| | | | | | | | | -134217694 cannot be represented in type 'int' Fixes: 1922/clusterfuzz-testcase-minimized-5561194112876544 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/wavpack: Check float_shiftMichael Niedermayer2017-05-30
| | | | | | | | Fixes: runtime error: shift exponent 40 is too large for 32-bit type 'unsigned int' Fixes: 1898/clusterfuzz-testcase-minimized-5970744880136192 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/wavpack: Fix runtime error: signed integer overflow: 24 * ↵Michael Niedermayer2017-05-30
| | | | | | | | | -2147483648 cannot be represented in type 'int' Fixes: 1894/clusterfuzz-testcase-minimized-4716739789062144 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/wavpack: Fix runtime error: signed integer overflow: -1386217472 * 4 ↵Michael Niedermayer2017-05-28
| | | | | | | | | cannot be represented in type 'int' Fixes: 1853/clusterfuzz-testcase-minimized-5471155626442752 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/wavpack: Fix runtime error: left shift of negative value -14778Michael Niedermayer2017-05-25
| | | | | | | Fixes: 1778/clusterfuzz-testcase-minimized-5128953268273152 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/wavpack: Fix: runtime error: signed integer overflow: 3 * ↵Michael Niedermayer2017-05-25
| | | | | | | | | -2147483648 cannot be represented in type 'int' Fixes: 1776/clusterfuzz-testcase-minimized-6191258231898112 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/wavpack: Fix runtime error: left shift of negative value -1Michael Niedermayer2017-05-24
| | | | | | | Fixes: 1807/clusterfuzz-testcase-minimized-6258676199325696 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/wavpack: Fix multiple runtime error: signed integer overflow: 548 * ↵Michael Niedermayer2017-05-21
| | | | | | | | | -2147483648 cannot be represented in type 'int' Fixes: 1659/clusterfuzz-testcase-minimized-5396490639900672 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/wavpack: Fix runtime error: signed integer overflow: 2147483642 + ↵Michael Niedermayer2017-05-13
| | | | | | | | | 512 cannot be represented in type 'int' Fixed: 1453/clusterfuzz-testcase-minimized-5024976874766336 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/wavpack: Fix signed integer overflow: 1285114081 * 2 cannot be ↵Michael Niedermayer2017-05-08
| | | | | | | | | | represented in type 'int' Fixes: 945/clusterfuzz-testcase-6037937588273152 Fixes: integer overflow Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/wavpack: Fix invalid shift and integer overflowMichael Niedermayer2017-05-04
| | | | | | | Fixes: 940/clusterfuzz-testcase-5200378381467648 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/wavpack: Check shiftMichael Niedermayer2017-03-21
| | | | | | | | Fixes: runtime error: shift exponent 255 is too large for 32-bit type 'unsigned int' Fixes: 894/clusterfuzz-testcase-4841537823309824 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/wavpack: Fix multiple integer overflowsMichael Niedermayer2017-03-16
| | | | | | | Fixes: 839/clusterfuzz-testcase-4871084446842880 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/wavpack: Fix runtime error: shift exponent 32 is too large for ↵Michael Niedermayer2017-03-14
| | | | | | | | | 32-bit type 'int' Fixes: 822/clusterfuzz-testcase-4873433189974016 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/wavpack: Fix runtime error: left shift of negative value -5Michael Niedermayer2017-03-08
| | | | | | | Fixes: 729/clusterfuzz-testcase-5154831595470848 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/wavpack: Fix runtime error: left shift of negative value -2Michael Niedermayer2017-03-05
| | | | | | | Fixes: 723/clusterfuzz-testcase-6471394663596032 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/wavpack: Check bitrate_acc for overflowMichael Niedermayer2017-03-05
| | | | | | | Fixes: undefined behavior in 717/clusterfuzz-testcase-5434924129583104 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/wavpack: Fix 280:22: runtime error: left shift of negative value -1Michael Niedermayer2017-02-25
| | | | | | Fixes: 653/clusterfuzz-testcase-5773837415219200 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/wavpack: Check post_shiftMichael Niedermayer2017-02-25
| | | | | | | | Fixes: runtime error: shift exponent 34 is too large for 32-bit type 'int' Fixes: 653/clusterfuzz-testcase-5773837415219200 Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/wavpacl: Fix runtime error: left shift of negative value -1Michael Niedermayer2017-02-19
| | | | | | | Fixes: 607/clusterfuzz-testcase-5108792465293312 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/wavpack: Treat the first block coding too many channels as an errorMichael Niedermayer2016-12-07
| | | | | | | | Fixes memleak Fixes: 236/8aeebc9ca49b91bf71c114dcefac56c154a3a563 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* Merge commit 'b668662939de3a02454cfc9ba3e6d10b87527a40'Clément Bœsch2016-06-29
|\ | | | | | | | | | | | | | | | | | | * commit 'b668662939de3a02454cfc9ba3e6d10b87527a40': get_bits: Move BITSTREAM_READER_LE definition before all relevant #includes The merge commit also includes changes for libavcodec/interplayacm.c and libavcodec/truemotion2rt.c Merged-by: Clément Bœsch <clement@stupeflix.com>
| * get_bits: Move BITSTREAM_READER_LE definition before all relevant #includesDiego Biurrun2016-06-07
| | | | | | | | | | | | | | This avoids the danger that get_bits.h might get indirectly #included before BITSTREAM_READER_LE is defined. Also sort headers into canonical order where appropriate.
| * lavc: Use get_bitsz where neededAndreas Cadhalpun2016-01-11
| | | | | | | | Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
* | lavc: use get_bitsz to simplify the codeAndreas Cadhalpun2016-01-03
| | | | | | | | | | Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>