summaryrefslogtreecommitdiff
path: root/libavcodec/alac.c
Commit message (Collapse)AuthorAge
* 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/alac: Check decorr_shift to avoid invalid shiftMichael Niedermayer2020-07-24
| | | | | | | | | | | | | Later the decorrelate_stereo call is guarded by channels == 2 and non-zero decorr_left_weight. Make sure decorr_shift is in the expected shift range for that case. Fixes: shift exponent 128 is too large for 32-bit type 'int' Fixes: 23860/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ALAC_fuzzer-5751138914402304 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Reviewed-by: Alexander Strasser <eclipse7@gmx.net> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/alac: remove FF_ALLOC_OR_GOTO and gotos labelLimin Wang2020-06-13
| | | | Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
* avcodec/alac: Add FF_CODEC_CAP_INIT_CLEANUPLimin Wang2020-06-13
| | | | Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
* avcodec/alac: Fix integer overflow with 24/20bps samplesMichael Niedermayer2020-05-11
| | | | | | | | Fixes: signed integer overflow: 1020048 * 4096 cannot be represented in type 'int' Fixes: 20492/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ALAC_fuzzer-5753877751660544 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg 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).
* avcodec/alac: Fix integer overflow in LPC coefficient adaptionMichael Niedermayer2020-01-11
| | | | | | | | Fixes: signed integer overflow: 267693597 * 10 cannot be represented in type 'int' Fixes: 19237/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ALAC_fuzzer-5755407700328448 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/alac: Fix integer overflow in lpc_prediction() with signMichael Niedermayer2019-12-01
| | | | | | | | Fixes: signed integer overflow: -2147483648 * -1 cannot be represented in type 'int' Fixes: 18643/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ALAC_fuzzer-5672182449700864 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/alac: Fix integer overflow in LPCMichael Niedermayer2019-10-20
| | | | | | | | Fixes: signed integer overflow: 2147483628 + 128 cannot be represented in type 'int' Fixes: 17783/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ALAC_fuzzer-5146470595952640 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/alac: Fix invalid shifts in 20/24 bpsMichael Niedermayer2019-09-24
| | | | | | | | Fixes: left shift of negative value -256 Fixes: 16892/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ALAC_fuzzer-4880802642395136 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/alac: fix undefined behavior with INT_MIN in lpc_prediction()Michael Niedermayer2019-09-24
| | | | | | | | Fixes: signed integer overflow: -2147483648 * -1 cannot be represented in type 'int' Fixes: 16786/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ALAC_fuzzer-5632818851348480 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/alac: Check for bps of 0Michael Niedermayer2019-08-26
| | | | | | | | | Fixes: shift exponent 32 is too large for 32-bit type 'unsigned int' Fixes: 15764/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ALAC_fuzzer-5102101203517440 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Reviewed-by: James Almer <jamrial@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/alac: Fix multiple integer overflows in lpc_prediction()Michael Niedermayer2019-08-23
| | | | | | | | | | | | | Fixes: signed integer overflow: 2088795537 + 2147254401 cannot be represented in type 'int' Fixes: signed integer overflow: -1500363496 + -1295351808 cannot be represented in type 'int' Fixes: signed integer overflow: -79560 * 32640 cannot be represented in type 'int' Fixes: signed integer overflow: 2088910005 + 2088796058 cannot be represented in type 'int' Fixes: signed integer overflow: -117258064 - 2088725225 cannot be represented in type 'int' Fixes: signed integer overflow: 2088725225 - -117258064 cannot be represented in type 'int' Fixes: 15739/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ALAC_fuzzer-5630664122040320 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/alac: Check lpc_quantMichael Niedermayer2019-07-08
| | | | | | | | | | | | | | lpc_quant of 0 produces undefined behavior, thus disallow this. If valid samples use this then such a sample would be quite usefull to confirm the correct&lossles handling of this. Fixes: libavcodec/alac.c:218:25: runtime error: shift exponent -1 is negative Fixes: 15273/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ALAC_fuzzer-5656388535058432 Fixes: 15276/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ALAC_fuzzer-5761238417539072 Fixes: 15315/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ALAC_fuzzer-5767260766994432 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* lavc/alac: Make a variable unsigned.Carl Eugen Hoyos2019-04-19
| | | | | | Fixes a bogus compiler warning (max_samples_per_frame is checked): libavcodec/alac.c: In function ‘allocate_buffers’: ./libavutil/internal.h:142:9: warning: argument 1 value ‘18446744073709551552’ exceeds maximum object size 9223372036854775807
* avcodec/alac: Avoid unspecific error codes and forward error codesMichael Niedermayer2019-01-01
| | | | | Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* lavc/alac: Avoid allocating huge memory blocks for malicious alac input.Carl Eugen Hoyos2017-11-04
|
* Merge commit '67deba8a416d818f3d95aef0aa916589090396e2'Clément Bœsch2017-03-31
|\ | | | | | | | | | | | | * commit '67deba8a416d818f3d95aef0aa916589090396e2': Use avpriv_report_missing_feature() where appropriate Merged-by: Clément Bœsch <cboesch@gopro.com>
| * Use avpriv_report_missing_feature() where appropriateDiego Biurrun2016-11-08
| |
* | Merge commit '796dca027be09334d7bbf4f2ac1200e06bb054cb'Clément Bœsch2017-03-19
|\| | | | | | | | | | | | | | | | | * commit '796dca027be09334d7bbf4f2ac1200e06bb054cb': alac: do not return success if nothing was decoded See e11983bda073f8c63f60509ee753da9fba20ed10 Merged-by: Clément Bœsch <u@pkh.me>
| * alac: do not return success if nothing was decodedAnton Khirnov2016-08-18
| | | | | | | | | | | | | | | | | | If we encounter an END element before anything is decoded, we would return success even though the output frame has not been allocated, which is invalid. CC: libav-stable@libav.org Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
* | lavc/alac: Export samplerate.Carl Eugen Hoyos2017-01-31
| | | | | | | | Fixes ticket #6096.
* | Merge commit '41ed7ab45fc693f7d7fc35664c0233f4c32d69bb'Clément Bœsch2016-06-21
|\| | | | | | | | | | | | | * commit '41ed7ab45fc693f7d7fc35664c0233f4c32d69bb': cosmetics: Fix spelling mistakes Merged-by: Clément Bœsch <u@pkh.me>
| * cosmetics: Fix spelling mistakesVittorio Giovara2016-05-04
| | | | | | | | Signed-off-by: Diego Biurrun <diego@biurrun.de>
* | avcodec/alac: fix 20-bit supportPaul B Mahol2016-05-05
| | | | | | | | Signed-off-by: Paul B Mahol <onemda@gmail.com>
* | avcodec: use AV_OPT_TYPE_BOOL in a bunch of placesClément Bœsch2015-12-04
| |
* | x86/alacdsp: add simd optimized functionsJames Almer2015-10-06
| | | | | | | | Signed-off-by: James Almer <jamrial@gmail.com>
* | avcodec/alacdec: split off decorrelate_stereo and append_extra_bits as alacdspJames Almer2015-10-04
| | | | | | | | | | Reviewed-by: Michael Niedermayer <michaelni@gmx.at> Signed-off-by: James Almer <jamrial@gmail.com>
* | 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>
* | avcodec/alac: remove dead code cruftHendrik Leppkes2015-09-06
| | | | | | | | | | The output is always planar since two major bumps, remove all code related to packed output.
* | 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/alac: Clear pointers in allocate_buffers()Michael Niedermayer2015-07-13
| | | | | | | | | | | | | | Fixes: 06a4edb39ad8a9883175f9bd428334a2_signal_sigsegv_7ffff713351a_706_mov__alac__ALAC_6ch.mov Found-by: Samuel Groß, Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | Merge commit '243e8443cd9e83c887e3f5edf09a169e7783d14e'Michael Niedermayer2015-05-10
|\| | | | | | | | | | | | | | | | | | | | | * commit '243e8443cd9e83c887e3f5edf09a169e7783d14e': alac: Reject rice_limit 0 if compression is used Conflicts: libavcodec/alac.c See: 4b657a1b1eedcf38bcf36e89a2f4be6f76b5ce09 Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * alac: Reject rice_limit 0 if compression is usedAndreas Cadhalpun2015-05-08
| | | | | | | | | | | | | | | | | | | | | | If in compression mode rice_limit = 0 leads to call `show_bits(gb, k)` in `decode_scalar` with k = 0. Request a sample in case it is valid and it should be accepted. Signed-off-by: Luca Barbato <lu_zero@gentoo.org> CC: libav-stable@libav.org
* | alac: reject rice_limit 0 if compression is usedAndreas Cadhalpun2015-04-24
| | | | | | | | | | | | | | If rice_limit is 0, k can be 0 in decode_scalar, which calls show_bits(gb, k). Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge commit '7f9f771eac0d37a632e0ed9bd89961d57fcfb7e0'Michael Niedermayer2015-02-14
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit '7f9f771eac0d37a632e0ed9bd89961d57fcfb7e0': avcodec: Don't anonymously typedef structs Conflicts: libavcodec/alac.c libavcodec/cinepak.c libavcodec/cscd.c libavcodec/dcadec.c libavcodec/g723_1.c libavcodec/gif.c libavcodec/iff.c libavcodec/kgv1dec.c libavcodec/libopenjpegenc.c libavcodec/libspeexenc.c libavcodec/ra288.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * avcodec: Don't anonymously typedef structsDiego Biurrun2015-02-14
| |
* | alac: add option to decoded incorrect ALACChristophe Gisquet2014-08-18
| | | | | | | | | | | | | | | | | | Prior to 56.1.100, incorrect ALAC files for 24bps content were produced, in particular not decoding losslessly. Add an option to allow correctly decoding those streams. Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge commit 'cc8163e1a3601a56f722a4720516e860bf1c6198'Michael Niedermayer2014-03-22
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit 'cc8163e1a3601a56f722a4720516e860bf1c6198': avcodec: more correct printf specifiers Conflicts: libavcodec/4xm.c libavcodec/alsdec.c libavcodec/dfa.c libavcodec/h264_ps.c libavcodec/jpeg2000dec.c libavcodec/lagarith.c libavcodec/mpeg12dec.c libavcodec/rv10.c libavcodec/svq3.c libavcodec/wmaprodec.c libavcodec/xwddec.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * avcodec: more correct printf specifiersDiego Biurrun2014-03-22
| |
* | avcodec/alac: warn if not all channels where decodedMichael Niedermayer2014-01-11
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avcodec/alac: only set *got_frame_ptr when all channels have been decodedMichael Niedermayer2014-01-11
| | | | | | | | | | | | | | Fixes use of uninitialized memory Fixes: msan_uninit-mem_7f8b64436530_7895_quicktime_newcodec_applelosslessaudiocodec.m4a Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind 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 '59480abce7e4238e22b3a4a904a9fe6abf4e4188'Michael Niedermayer2013-09-29
|\| | | | | | | | | | | | | | | * commit '59480abce7e4238e22b3a4a904a9fe6abf4e4188': alac: Do bounds checking of lpc_order read from the bitstream See: fd4f4923cce6a2cbf4f48640b4ac706e614a1594 Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * alac: Do bounds checking of lpc_order read from the bitstreamMartin Storsjö2013-09-29
| | | | | | | | | | | | | | | | | | In lpc_prediction(), we write up to array element 'lpc_order' in an array allocated to hold 'max_samples_per_frame' elements. Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind CC: libav-stable@libav.org Signed-off-by: Martin Storsjö <martin@martin.st>
* | Merge commit '35cbc98b720db95b923cb2d745f77bb2ee4363dc'Michael Niedermayer2013-09-04
|\| | | | | | | | | | | | | | | | | | | | | * commit '35cbc98b720db95b923cb2d745f77bb2ee4363dc': alac: Check that the channels fit at the given offset Conflicts: libavcodec/alac.c See: b53f89710b03c4c832bb03e4e132b1ace17fb4e4 Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * alac: Check that the channels fit at the given offsetMartin Storsjö2013-09-03
| | | | | | | | | | | | | | | | | | | | | | | | | | The code tries to decode a number of channels at the offset given by the ff_alac_channel_layout_offsets table. Even if the number of channels decoded so far doesn't exceed the total number of channels, we need to check that we actually can decode that number of channels at this offset as well. Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind CC: libav-stable@libav.org Signed-off-by: Martin Storsjö <martin@martin.st>
* | Merge commit 'f7c5883126f9440547933eefcf000aa78af4821c'Michael Niedermayer2013-09-04
|\| | | | | | | | | | | | | | | * commit 'f7c5883126f9440547933eefcf000aa78af4821c': alac: Limit max_samples_per_frame See: 3920d1387834e2bc334aff9f518f4beb24e470bd Merged-by: Michael Niedermayer <michaelni@gmx.at>