summaryrefslogtreecommitdiff
path: root/libavcodec/flacdec.c
Commit message (Collapse)AuthorAge
* 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).
* avcodec/flacdec: Fix overflow in multiplication in decode_subframe_fixed()Michael Niedermayer2017-12-28
| | | | | | | | Fixes: signed integer overflow: 2 * 1629495328 cannot be represented in type 'int' Fixes: 4716/clusterfuzz-testcase-minimized-5835915940331520 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/flacdec: avoid undefined shiftMichael Niedermayer2017-12-28
| | | | | | | | Fixes: shift exponent 32 is too large for 32-bit type 'unsigned int' Fixes: 4688/clusterfuzz-testcase-minimized-6572210748653568 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* Merge commit '0f5ad12ba2b538cb329c507ecc914e06bfa70194'James Almer2017-11-07
|\ | | | | | | | | | | | | * commit '0f5ad12ba2b538cb329c507ecc914e06bfa70194': flac: Use a local cache for decode_residual() Merged-by: James Almer <jamrial@gmail.com>
| * flac: Use a local cache for decode_residual()Luca Barbato2017-07-09
| | | | | | | | | | | | About an additional 4% speedup. Signed-off-by: Diego Biurrun <diego@biurrun.de>
* | Merge commit '15f1cc09a406cf6296818d475a256902235eefc4'James Almer2017-11-07
|\| | | | | | | | | | | | | * commit '15f1cc09a406cf6296818d475a256902235eefc4': flac: Postpone unlikely condition checks Merged-by: James Almer <jamrial@gmail.com>
| * flac: Postpone unlikely condition checksLuca Barbato2017-07-09
| | | | | | | | | | | | About 2% speedup on gcc-6.3. Signed-off-by: Diego Biurrun <diego@biurrun.de>
| * flac: Convert to the new bitstream readerAlexandra Hájková2017-07-09
| | | | | | | | Signed-off-by: Diego Biurrun <diego@biurrun.de>
| * golomb: Convert to the new bitstream readerDiego Biurrun2017-01-31
| |
* | avcodec/flacdec: Return error code instead of 0 for failuresMichael Niedermayer2017-05-09
| | | | | | | | | | | | | | | | Fixes: infinite loop Fixes: 1418/clusterfuzz-testcase-minimized-5934472438480896 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avcodec/flacdec: reduce limit for golomb so that the max value does not overflowMichael Niedermayer2017-02-21
| | | | | | | | | | | | | | | | Fixes: runtime error: left shift of 32 by 26 places cannot be represented in type 'int' Fixes: 628/clusterfuzz-testcase-6187747641393152 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avcodec/flac: Fix several integer overflowsMichael Niedermayer2017-02-19
| | | | | | | | | | | | Fixes: 686513-media Found-by: Matt Wolenetz <wolenetz@google.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avcodec/flacdec: Check for invalid vlcsMichael Niedermayer2017-02-04
| | | | | | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avcodec/flacdec: Fix undefined shift in decode_subframe()Michael Niedermayer2016-12-04
| | | | | | | | | | | | | | | | Fixes undefined behavior Fixes: 639961-media Found-by: Matt Wolenetz <wolenetz@google.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avcodec/flac: forward errors from ff_flac_parse_streaminfo()Michael Niedermayer2016-12-03
| | | | | | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avcodec/flacdec: Fix signed integer overflow in decode_subframe_fixed()Michael Niedermayer2016-12-03
| | | | | | | | | | | | | | | | Fixes undefined behavior Fixes: 640912-media Found-by: Matt Wolenetz <wolenetz@google.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avcodec: use AV_OPT_TYPE_BOOL in a bunch of placesClément Bœsch2015-12-04
| |
* | avcodec: use HAVE_THREADS header guards to silence -Wunused-functionGanesh Ajjanagadde2015-10-04
| | | | | | | | | | | | | | | | | | | | When compiled with --disable-pthreads, e.g http://fate.ffmpeg.org/report.cgi?time=20150917015044&slot=alpha-debian-qemu-gcc-4.7, a bunch of -Wunused-functions are reported due to missing header guards around threading related functions. This patch should silence such warnings. Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
* | Merge commit 'def97856de6021965db86c25a732d78689bd6bb0'Michael Niedermayer2015-07-27
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit 'def97856de6021965db86c25a732d78689bd6bb0': lavc: AV-prefix all codec capabilities Conflicts: cmdutils.c ffmpeg.c ffplay.c libavcodec/8svx.c libavcodec/aacenc.c libavcodec/ac3dec.c libavcodec/adpcm.c libavcodec/alac.c libavcodec/atrac3plusdec.c libavcodec/bink.c libavcodec/dnxhddec.c libavcodec/dvdec.c libavcodec/dvenc.c libavcodec/ffv1dec.c libavcodec/ffv1enc.c libavcodec/fic.c libavcodec/flacdec.c libavcodec/flacenc.c libavcodec/flvdec.c libavcodec/fraps.c libavcodec/frwu.c libavcodec/gifdec.c libavcodec/h261dec.c libavcodec/hevc.c libavcodec/iff.c libavcodec/imc.c libavcodec/libopenjpegdec.c libavcodec/libvo-aacenc.c libavcodec/libvorbisenc.c libavcodec/libvpxdec.c libavcodec/libvpxenc.c libavcodec/libx264.c libavcodec/mjpegbdec.c libavcodec/mjpegdec.c libavcodec/mpegaudiodec_float.c libavcodec/msmpeg4dec.c libavcodec/mxpegdec.c libavcodec/nvenc_h264.c libavcodec/nvenc_hevc.c libavcodec/pngdec.c libavcodec/qpeg.c libavcodec/ra288.c libavcodec/rv10.c libavcodec/s302m.c libavcodec/sp5xdec.c libavcodec/takdec.c libavcodec/tiff.c libavcodec/tta.c libavcodec/utils.c libavcodec/v210dec.c libavcodec/vp6.c libavcodec/vp9.c libavcodec/wavpack.c libavcodec/yop.c Merged-by: Michael Niedermayer <michael@niedermayer.cc>
| * lavc: AV-prefix all codec capabilitiesVittorio Giovara2015-07-27
| | | | | | | | | | | | Express bitfields more simply. Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
* | avcodec/flacdec: Attempt to auto-detect old buggy flacMichael Niedermayer2015-05-17
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | lavc/flac: Fix encoding and decoding with high lpc.Carl Eugen Hoyos2015-05-17
| | | | | | | | | | | | Based on an analysis by trac user lvqcl. Fixes ticket #4421, reported by Chase Walker.
* | lavc/flacdec: Sanitize FLACSTREAMINFO usage.Carl Eugen Hoyos2015-05-17
| |
* | avcodec/flacdec: fix off by 1 errorMichael Niedermayer2014-11-26
| | | | | | | | | | | | | | Fixes assertion failure Fixes: signal_sigsegv_324b284_1980_dilvie___the_dragonfly.flac Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avcodec/flacdec: Call ff_flacdsp_init() unconditionallyMichael Niedermayer2014-11-26
| | | | | | | | | | | | | | Fixes out of array access Fixes: signal_sigsegv_324b135_3398_cov_246853371_short.flac Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | x86/flacdsp: add SSE2 and AVX decorrelate functionsJames Almer2014-11-13
| | | | | | | | Two to four times faster depending on instruction set, block size and channel count.
* | Merge commit 'acc897e6b15776ed438b88ffe330ec48f6b50e48'Michael Niedermayer2014-11-06
|\| | | | | | | | | | | | | * commit 'acc897e6b15776ed438b88ffe330ec48f6b50e48': lavc: make avpriv_flac_is_extradata_valid() private on the next bump Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * lavc: make avpriv_flac_is_extradata_valid() private on the next bumpAnton Khirnov2014-11-06
| |
* | Merge commit 'c070a8751597e3aa1b443e88464da785d8966b14'Michael Niedermayer2014-11-06
|\| | | | | | | | | | | | | * commit 'c070a8751597e3aa1b443e88464da785d8966b14': lavc: make avpriv_flac_parse_streaminfo() private on the next bump Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * lavc: make avpriv_flac_parse_streaminfo() private on the next bumpAnton Khirnov2014-11-06
| |
* | Merge commit '7703995a2e8760e66ff35148bf029e0f9e30dbe6'Michael Niedermayer2014-09-26
|\| | | | | | | | | | | | | | | | | | | * commit '7703995a2e8760e66ff35148bf029e0f9e30dbe6': flac: Remove unused headers Conflicts: libavcodec/flacdec.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * flac: Remove unused headersTristan Matthews2014-09-26
| | | | | | | | Signed-off-by: Diego Biurrun <diego@biurrun.de>
* | avcodec/flacdec: fix handling of av_samples_fill_arrays() return valueMichael Niedermayer2014-08-10
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge commit '5fdaf312c5541b77b6364db8b49d6abb416a25c0'Michael Niedermayer2014-05-28
|\| | | | | | | | | | | | | * commit '5fdaf312c5541b77b6364db8b49d6abb416a25c0': flac: make avpriv_flac_parse_block_header() inline Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * flac: make avpriv_flac_parse_block_header() inlineAnton Khirnov2014-05-28
| | | | | | | | | | | | This avoids all the ABI troubles associated with avpriv_. Since this function is very small and does not depend on any tables, making it inline should have no adverse effects.
* | Fix skiping typosMichael Niedermayer2014-04-27
| | | | | | | | | | Found-by: Alessandro Ghedini <alessandro@ghedini.me> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avcodec/flacdec: check rice_order against blocksizeMichael Niedermayer2014-01-07
| | | | | | | | | | | | | | Fixes use of uninitialized memory Fixes: msan_uninit-mem_7f6e13c220d0_8489_short.flac Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avcodec/flacdec: use get_unary() simplify codeMichael Niedermayer2013-10-30
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avcodec/flacdec: make while get_bits loop more robust by checking bits leftMichael Niedermayer2013-10-30
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avcodec/flacdec: also do crc check when er compliant is setMichael Niedermayer2013-10-27
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge commit 'b2bed9325dbd6be0da1d91ffed3f513c40274fd2'Michael Niedermayer2013-10-04
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit 'b2bed9325dbd6be0da1d91ffed3f513c40274fd2': cosmetics: Group .name and .long_name together in codec/format declarations Conflicts: libavcodec/8svx.c libavcodec/alac.c libavcodec/cljr.c libavcodec/dnxhddec.c libavcodec/dnxhdenc.c libavcodec/dpxenc.c libavcodec/dvdec.c libavcodec/dvdsubdec.c libavcodec/dvdsubenc.c libavcodec/ffv1dec.c libavcodec/flacdec.c libavcodec/flvdec.c libavcodec/fraps.c libavcodec/frwu.c libavcodec/g726.c libavcodec/gif.c libavcodec/gifdec.c libavcodec/h261dec.c libavcodec/h263dec.c libavcodec/iff.c libavcodec/imc.c libavcodec/libopencore-amr.c libavcodec/libopenjpegdec.c libavcodec/libopenjpegenc.c libavcodec/libspeexenc.c libavcodec/libvo-amrwbenc.c libavcodec/libvorbisenc.c libavcodec/libvpxenc.c libavcodec/libx264.c libavcodec/libxavs.c libavcodec/libxvid.c libavcodec/ljpegenc.c libavcodec/mjpegbdec.c libavcodec/mjpegdec.c libavcodec/mpeg12dec.c libavcodec/mpeg4videodec.c libavcodec/msmpeg4dec.c libavcodec/pgssubdec.c libavcodec/pngdec.c libavcodec/pngenc.c libavcodec/proresdec_lgpl.c libavcodec/proresenc_kostya.c libavcodec/ra144enc.c libavcodec/rawdec.c libavcodec/rv10.c libavcodec/sp5xdec.c libavcodec/takdec.c libavcodec/tta.c libavcodec/v210dec.c libavcodec/vp6.c libavcodec/wavpack.c libavcodec/xbmenc.c libavcodec/yop.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * cosmetics: Group .name and .long_name together in codec/format declarationsDiego Biurrun2013-10-03
| |
* | Merge commit '45ee556d51ef04d79d52bf6b0b7f28a4d231cb0c'Michael Niedermayer2013-07-29
|\| | | | | | | | | | | | | | | | | | | | | * commit '45ee556d51ef04d79d52bf6b0b7f28a4d231cb0c': qdm2: Whitespace cosmetics flac: use meaningful return values Conflicts: libavcodec/flacdec.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * flac: use meaningful return valuesLuca Barbato2013-07-28
| |
| * flacdec: drop unnecessary assertLuca Barbato2013-05-16
| | | | | | | | The condition cannot happen anymore.
* | lavc: copy AVCodecContext for threadsPaul B Mahol2013-06-13
| | | | | | | | Signed-off-by: Paul B Mahol <onemda@gmail.com>
* | flacdec: Fix used AVCodecContextMichael Niedermayer2013-06-13
| | | | | | | | | | | | | | Fixes out of array writes with multiple threads Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | lavc: add ONLY_IF_THREADS_ENABLED where it is missingPaul B Mahol2013-06-06
| | | | | | | | Signed-off-by: Paul B Mahol <onemda@gmail.com>
* | flacdec: don't call allocate_buffers() in init_thread_copy() when ↵Paul B Mahol2013-06-06
| | | | | | | | | | | | | | | | | | s->max_blocksize is 0 This is normal, and happens when no extradata was available at decoder initialization. Signed-off-by: Paul B Mahol <onemda@gmail.com>
* | flacdec: frame multi-threading supportPaul B Mahol2013-06-05
| | | | | | | | Signed-off-by: Paul B Mahol <onemda@gmail.com>