summaryrefslogtreecommitdiffstats
path: root/libavcodec/ac3dec.c
Commit message (Collapse)AuthorAgeFilesLines
* avcodec/ac3: Explicitly return to discard large amounts of nonsense bytesMichael Niedermayer2019-02-071-0/+2
| | | | | | | | | | | Changes 19sec to 10ms (12559) runtime, 17sec to 177ms (12570) Fixes: Timeout Fixes: 12559/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_AC3_fuzzer-5666516266123264 Fixes: 12561/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_AC3_FIXED_fuzzer-5682923041193984 Fixes: 12570/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_EAC3_fuzzer-5194734308425728 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/ac3dec: Optimize frame start searchMichael Niedermayer2019-01-161-6/+14
| | | | | | | | | | | | | Fixes: Timeout Fixes: 11619/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_AC3_FIXED_fuzzer-5632398021099520 Fixes: 11620/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_AC3_fuzzer-5711996515778560 Fixes: 11658/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_EAC3_fuzzer-5701006524940288 Before: Executed clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_AC3_FIXED_fuzzer-5632398021099520 in 20338 ms After: Executed clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_AC3_FIXED_fuzzer-5632398021099520 in 11825 ms Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* libavcodec/ac3dec.c: Avoid unspecific -1 error codeMichael Niedermayer2019-01-011-1/+1
| | | | | Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/ac3dec: always skip junk bytes before sync bytesPaul B Mahol2018-11-301-3/+17
| | | | Fixes #7278.
* avcodec/ac3dec: Fix shift signedness in mask creationMichael Niedermayer2018-09-221-2/+2
| | | | | | | | Fixes: 9924/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_EAC3_fuzzer-5473421772193792 Fixes: left shift of 1 by 63 places cannot be represented in type 'long long' Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/eac3dec: Check that channel_map does not contain more than ↵Michael Niedermayer2018-09-221-23/+4
| | | | | | EAC3_MAX_CHANNELS Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/ac3dec: Check channel_map indexMichael Niedermayer2018-07-041-0/+7
| | | | | | | | Fixes: out of array read Fixes: 8924/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_EAC3_fuzzer-5851861780267008 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/ac3dec: Check that the number of channels with dependant streams is ↵Michael Niedermayer2018-05-271-0/+5
| | | | | | | | | | | valid Fixes: left shift of 1 by 63 places cannot be represented in type 'long long' Fixes: out of array access Fixes: 7284/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_AC3_fuzzer-5767914968842240 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/ac3dec: Fix null pointer dereference in ac3_decode_frame()Michael Niedermayer2018-05-271-1/+3
| | | | | | | | Fixes: index 8 out of bounds for type 'uint8_t *[8]' Fixes: 7273/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_EAC3_fuzzer-6296497667702784 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/ac3dec: Use frame_size if superframe_size is 0Michael Niedermayer2018-05-261-0/+3
| | | | | | | | | | Fixes: Infinite loop Fixes: 7669/clusterfuzz-testcase-ffmpeg_AV_CODEC_ID_AC3_FIXED_fuzzer-4689042185650176 Fixes: 7670/clusterfuzz-testcase-ffmpeg_AV_CODEC_ID_AC3_fuzzer-4706306762997760 Fixes: 7672/clusterfuzz-testcase-ffmpeg_AV_CODEC_ID_EAC3_fuzzer-4702108499574784 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/ac3: fix out of array access introduced previouslyPaul B Mahol2018-03-301-5/+5
| | | | Signed-off-by: Paul B Mahol <onemda@gmail.com>
* avcodec/eac3: add support for dependent streamPaul B Mahol2018-03-291-34/+145
| | | | Signed-off-by: Paul B Mahol <onemda@gmail.com>
* Merge commit '50a1c66cf6ab7eb683daaa9e2da3869fa3a54609'James Almer2017-10-271-3/+3
|\ | | | | | | | | | | | | | | | | | | | | * commit '50a1c66cf6ab7eb683daaa9e2da3869fa3a54609': ac3_parser: add a public function for parsing the data required by the demuxer avpriv_ac3_parse_header() is left in place but without the GetBitContext parameter, as the mov muxer requires a lot more fields than just bitstream_id and frame_size from the AC3HeaderInfo struct. Merged-by: James Almer <jamrial@gmail.com>
| * ac3_parser: add a public function for parsing the data required by the demuxerAnton Khirnov2017-04-121-2/+2
| | | | | | | | | | | | Make the current semi-public avpriv_ac3_parse_header() private to lavc. Signed-off-by: Diego Biurrun <diego@biurrun.de>
* | avcodec/ac3dec: Fix: runtime error: index -1 out of bounds for type ↵Michael Niedermayer2017-05-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | 'INTFLOAT [2]' It seems dual mono with a LFE channel is not forbidden Fixes: 1570/clusterfuzz-testcase-minimized-6455337349545984 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avcodec/ac3dec: Keep track of band structureMichael Niedermayer2017-05-131-12/+15
| | | | | | | | | | | | | | | | | | It is needed in some corner cases that seem not to be forbidden Fixes: out of array index Fixes: 1538/clusterfuzz-testcase-minimized-4696904925446144 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avcodec: do not use AVFrame accessorMuhammad Faiz2017-04-231-1/+1
| | | | | | | | | | Reviewed-by: wm4 <nfxjfg@googlemail.com> Signed-off-by: Muhammad Faiz <mfcc64@gmail.com>
* | Merge commit 'b57e38f52cc3f31a27105c28887d57cd6812c3eb'Clément Bœsch2017-03-221-3/+3
|\ \ | |/ | | | | | | | | | | * commit 'b57e38f52cc3f31a27105c28887d57cd6812c3eb': ac3dsp: x86: Replace inline asm for in-decoder downmixing with standalone asm Merged-by: Clément Bœsch <u@pkh.me>
| * ac3dsp: x86: Replace inline asm for in-decoder downmixing with standalone asmJustin Ruggles2016-10-011-4/+4
| | | | | | | | | | | | | | | | | | Adds a wrapper function for downmixing which detects channel count changes and updates the selected downmix function accordingly. Simplification and porting to current x86inc infrastructure by Diego Biurrun. Signed-off-by: Diego Biurrun <diego@biurrun.de>
* | Merge commit '43717469f9daa402f6acb48997255827a56034e9'Clément Bœsch2017-03-221-16/+30
|\ \ | |/ | | | | | | | | | | * commit '43717469f9daa402f6acb48997255827a56034e9': ac3dsp: Reverse matrix in/out order in downmix() Merged-by: Clément Bœsch <u@pkh.me>
| * ac3dsp: Reverse matrix in/out order in downmix()Justin Ruggles2016-10-011-13/+27
| | | | | | | | | | | | | | Also use (float **) instead of (float (*)[2]). This matches the matrix layout in libavresample so we can reuse assembly code between the two. Signed-off-by: Diego Biurrun <diego@biurrun.de>
* | Merge commit '8495d84f0101464b15517860db33e8605586d87e'Clément Bœsch2017-03-151-3/+3
|\ \ | |/ | | | | | | | | | | * commit '8495d84f0101464b15517860db33e8605586d87e': ac3dec: Add some inline hints Merged-by: Clément Bœsch <u@pkh.me>
| * ac3dec: Add some inline hintsLuca Barbato2016-07-291-3/+3
| | | | | | | | Signed-off-by: Diego Biurrun <diego@biurrun.de>
* | Merge commit '3db51bf671defd47f2ec5ab67b11fb7730fb5e5a'Clément Bœsch2017-03-151-2/+1
|\ \ | |/ | | | | | | | | | | * commit '3db51bf671defd47f2ec5ab67b11fb7730fb5e5a': ac3dec: Simplify skipping Merged-by: Clément Bœsch <u@pkh.me>
| * ac3dec: Simplify skippingLuca Barbato2016-07-291-2/+1
| | | | | | | | | | | | skip_bits_long() can skip up to 32-bit ranges. Signed-off-by: Diego Biurrun <diego@biurrun.de>
* | Merge commit 'f0ccc65bc9ab9ddf1366066395564c71bcc825ee'Clément Bœsch2017-03-151-91/+116
|\ \ | |/ | | | | | | | | | | * commit 'f0ccc65bc9ab9ddf1366066395564c71bcc825ee': ac3dec: Split coupling-specific code from decode_audio_block() Merged-by: Clément Bœsch <u@pkh.me>
| * ac3dec: Split coupling-specific code from decode_audio_block()Luca Barbato2016-07-291-91/+116
| | | | | | | | Signed-off-by: Diego Biurrun <diego@biurrun.de>
* | Merge commit 'a5ebe5d1217942238c641c83b24ef1106e53934a'Clément Bœsch2017-03-151-122/+139
|\ \ | |/ | | | | | | | | | | * commit 'a5ebe5d1217942238c641c83b24ef1106e53934a': ac3dec: Split spx-specific code from decode_audio_block() Merged-by: Clément Bœsch <u@pkh.me>
| * ac3dec: Split spx-specific code from decode_audio_block()Luca Barbato2016-07-291-90/+108
| | | | | | | | Signed-off-by: Diego Biurrun <diego@biurrun.de>
* | avcodec/ac3dec: add consistent noise generation option.Jonathan Campbell2017-01-221-0/+7
| | | | | | | | | | | | | | use av_lfg_init_from_data() to seed AC-3 dithering from the AC-3 frame data to make it consistent given the same AC-3 frame, if option is set. Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avcodec/ac3dec: Check expaccMichael Niedermayer2016-11-031-0/+4
| | | | | | | | | | | | | | | | | | | | this is somewhat a magic number, which can be understood from reading section "7.1.2 Exponent Strategy" of the ac3 specification, in short: Three exponents each represented as number 0-4 are grouped together and base-5 encoded, so the maximal correct value is 25*4 + 5*4 + 4 = 124. Reviewed-by: Andreas Cadhalpun <andreas.cadhalpun@googlemail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avcodec/(e)ac3: Fix target_level for EAC3.Nikolas Bowe2016-09-151-3/+6
| | | | | | | | | | | | | | | | | | | | | | Currently when using target_level with EAC3 it produces silence. This small patch fixes target_level for decoding EAC3. Example: ffmpeg -y -i /tmp/test.wav -acodec eac3 -dialnorm -14 -ac 6 -b:a 384000 /tmp/test.m2ts ffmpeg -y -target_level -24 -i /tmp/test.m2ts -acodec pcm_s16le -f matroska /tmp/out.mkv ffplay /tmp/out.mkv Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | Merge commit '33275a0de05e9bc321f2537a2a67921fab81624f'Derek Buitenhuis2016-05-081-2/+3
|\ \ | |/ | | | | | | | | | | * commit '33275a0de05e9bc321f2537a2a67921fab81624f': ac3dec: change logging of skipped E-AC-3 substreams. Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
| * ac3dec: change logging of skipped E-AC-3 substreams.Tim Walker2016-04-021-2/+3
| | | | | | | | | | | | | | | | | | Change log level from warning to debug: the E-AC-3 "core" substream can be successfully decoded without the additional and dependent substreams, and their presence is already indicated via avpriv_request_sample in ff_eac3_parse_header. Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
* | avcodec/ac3dec: Reset SPX when switching from EAC3 to AC3Michael Niedermayer2016-04-251-5/+7
| | | | | | | | | | | | Fixes Ticket5319 Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avcodec/ac3dec: Print the value of out of range exponentsMichael Niedermayer2015-12-241-4/+6
| | | | | | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avcodec/ac3: always use hardcoded tablesGanesh Ajjanagadde2015-11-301-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The table in question is a 253 byte one. In fact, it turns out that dynamic generation of the table results in an increased binary size. Code compiled with GCC 5.2.0, x86-64 (size in bytes), before and after patch: old: 62321064 libavcodec/libavcodec.so.57 new: 62320536 libavcodec/libavcodec.so.57 Thus, it always make sense to statically allocate this. Tested with FATE with/without --enable-hardcoded-tables. Reviewed-by: wm4 <nfxjfg@googlemail.com> Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
* | avcodec: drop 2 suffix from avpriv_ac3_parse_header2Andreas Cadhalpun2015-10-221-1/+1
| | | | | | | | | | | | | | avpriv_ac3_parse_header was removed in commit 3dfb643. Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
* | Merge commit 'dc70c19476e76f1118df73b5d97cc76f0e5f6f6c'Hendrik Leppkes2015-09-051-8/+0
|\ \ | |/ | | | | | | | | | | * commit 'dc70c19476e76f1118df73b5d97cc76f0e5f6f6c': lavc: Drop deprecated request_channels related functions Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
| * lavc: Drop deprecated request_channels related functionsVittorio Giovara2015-08-281-8/+0
| | | | | | | | Deprecated in 04/2011.
| * lavc: AV-prefix all codec capabilitiesVittorio Giovara2015-07-271-2/+2
| | | | | | | | | | | | Express bitfields more simply. Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
* | Merge commit '7c6eb0a1b7bf1aac7f033a7ec6d8cacc3b5c2615'Michael Niedermayer2015-07-271-3/+3
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit '7c6eb0a1b7bf1aac7f033a7ec6d8cacc3b5c2615': lavc: AV-prefix all codec flags Conflicts: doc/examples/muxing.c ffmpeg.c ffmpeg_opt.c ffplay.c libavcodec/aacdec.c libavcodec/aacenc.c libavcodec/ac3dec.c libavcodec/ac3enc_float.c libavcodec/atrac1.c libavcodec/atrac3.c libavcodec/atrac3plusdec.c libavcodec/dcadec.c libavcodec/ffv1enc.c libavcodec/h264.c libavcodec/h264_loopfilter.c libavcodec/h264_mb.c libavcodec/imc.c libavcodec/libmp3lame.c libavcodec/libtheoraenc.c libavcodec/libtwolame.c libavcodec/libvpxenc.c libavcodec/libxavs.c libavcodec/libxvid.c libavcodec/mpeg12dec.c libavcodec/mpeg12enc.c libavcodec/mpegaudiodec_template.c libavcodec/mpegvideo.c libavcodec/mpegvideo_enc.c libavcodec/mpegvideo_motion.c libavcodec/nellymoserdec.c libavcodec/nellymoserenc.c libavcodec/nvenc.c libavcodec/on2avc.c libavcodec/options_table.h libavcodec/opus_celt.c libavcodec/pngenc.c libavcodec/ra288.c libavcodec/ratecontrol.c libavcodec/twinvq.c libavcodec/vc1_block.c libavcodec/vc1_loopfilter.c libavcodec/vc1_mc.c libavcodec/vc1dec.c libavcodec/vorbisdec.c libavcodec/vp3.c libavcodec/wma.c libavcodec/wmaprodec.c libavcodec/x86/hpeldsp_init.c libavcodec/x86/me_cmp_init.c Merged-by: Michael Niedermayer <michael@niedermayer.cc>
| * lavc: AV-prefix all codec flagsVittorio Giovara2015-07-271-2/+2
| | | | | | | | | | | | Convert doxygen to multiline and express bitfields more simply. Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
* | avcodec/ac3dec: Put CONFIG* first in if()Michael Niedermayer2015-03-261-2/+2
| | | | | | | | | | | | This may fix build failures with EAC3 disabled and is more consistent Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avcodec/ac3dec_fixed: fix compilation when ac3dec is disabledJames Almer2015-03-171-1/+1
| | | | | | | | | | Reviewed-by: Michael Niedermayer <michaelni@gmx.at> Signed-off-by: James Almer <jamrial@gmail.com>
* | avcodec/ac3dec: Fix undefined shiftsMichael Niedermayer2015-03-151-4/+3
| | | | | | | | | | | | Found-by: Clang -fsanitize=shift Reported-by: Thierry Foucu <tfoucu@google.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | ac3dec: cosmeticsChristophe Gisquet2015-03-141-5/+3
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | ac3_fixed: fix computation of spx_noise_blendChristophe Gisquet2015-03-141-1/+1
| | | | | | | | | | | | It was set to 1 instead of sqrt(3) Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | ac3_fixed: fix out-of-bound readChristophe Gisquet2015-03-141-1/+1
| | | | | | | | | | | | Should also improve decoding, but actually doesn't... Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge commit '7f9f771eac0d37a632e0ed9bd89961d57fcfb7e0'Michael Niedermayer2015-02-141-1/+1
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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>
OpenPOWER on IntegriCloud