summaryrefslogtreecommitdiffstats
path: root/libavcodec/aacdec_template.c
Commit message (Collapse)AuthorAgeFilesLines
* avcodec/aacdec_template: Check samplerateMichael Niedermayer2019-11-011-0/+3
| | | | | | | | Fixes: signed integer overflow: 2 * 1881153568 cannot be represented in type 'int' Fixes: 17996/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_AAC_FIXED_fuzzer-5687126468853760 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/aacdec_template: Check decode_extension_payload() for failureMichael Niedermayer2019-10-161-3/+9
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/mpeg4audio: add avpriv_mpeg4audio_get_config2()James Almer2019-09-271-1/+1
| | | | | | | | | | Identical to avpriv_mpeg4audio_get_config() except taking a size argument in bytes, and featuring a new logging context paremeter. Schedule avpriv_mpeg4audio_get_config() for removal as soon as major is bumped as well. Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/aacdec_template: fix integer overflow in imdct_and_windowing()Michael Niedermayer2019-08-111-1/+1
| | | | | | | | Fixes: signed integer overflow: 2147483645 + 4 cannot be represented in type 'int' Fixes: 15418/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_AAC_FIXED_fuzzer-5685269069561856 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/aacdec_template: skip apply_tns() if max_sfb is 0 (from previous ↵Michael Niedermayer2019-06-041-0/+3
| | | | | | | | | | | header decode failure) Fixes: NULL pointer dereference Fixes: 14723/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_AAC_LATM_fuzzer-5654612436058112 Fixes: 14724/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_AAC_LATM_fuzzer-5712607111020544 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/aacdec_template: Merge 3 #ifs related to noise handlingMichael Niedermayer2019-06-041-9/+8
| | | | | | Fewer #if and fewer lines Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/aacdec_fixed: Provide context to av_log()Michael Niedermayer2019-01-011-2/+2
| | | | | Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/aacdec_template: Allow duplicated elementsMichael Niedermayer2018-10-121-4/+7
| | | | | | | | | | | | | | | Such streams are invalid according to 4.5.2.1 Top level payloads for the audio object types AAC main, AAC SSR, AAC LC and AAC LTP 4.5.2.1.1 Definitions ...cIn the raw_data_block(), several instances of the same syntactic element may occur, but must have a different 4 bit element_instance_tag, except for data_stream_element()'s and fill_element()'s. Fixes: Ticket7477 Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/aacdec_template: Check for duplicate elementsMichael Niedermayer2018-08-041-0/+9
| | | | | | | | Fixes: Timeout Fixes: 9552/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_AAC_FIXED_fuzzer-6027842339995648 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* aac: Rework extradata parsing codeVittorio Giovara2018-04-191-14/+8
| | | | | | | - enable the parsing code - use the new buffer instead of replacing the context one - do not push/pop configuration, just discard the exiting one - propagate errors correctly
* Parse and drop gain control data, so that SSR packets decode.Dale Curtis2018-02-211-3/+33
| | | | | | | | | | | | | | This will result in poor quality audio for SSR streams, but they will at least demux and decode without error; partially fixing ticket #1693. This pulls in the decode_gain_control() function from the ffmpeg summer-of-code repo (original author Maxim Gavrilov) at svn://svn.mplayerhq.hu/soc/aac/aac.c with some minor modifications and adds AOT_AAC_SSR to decode_audio_specific_config_gb(). Signed-off-by: Dale Curtis <dalecurtis@chromium.org> Co-authored-by: Maxim Gavrilov <maxim.gavrilov@gmail.com>
* avcodec/aacdec_templat: Fix integer overflow in apply_ltp()Michael Niedermayer2018-02-201-1/+1
| | | | | | | | Fixes: signed integer overflow: -1625276744 + -1041893960 cannot be represented in type 'int' Fixes: 5948/clusterfuzz-testcase-minimized-5791479856365568 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 'b5f19f7478492307e4b4763aeac3180faf50e17f'James Almer2017-10-301-1/+1
| | | | | | | * commit 'b5f19f7478492307e4b4763aeac3180faf50e17f': aac: Split function to parse ADTS header data into public and private part Merged-by: James Almer <jamrial@gmail.com>
* avcodec/aacdec_template: Clear tns present flag on errorMichael Niedermayer2017-10-041-16/+28
| | | | | | | Fixes: 3444/clusterfuzz-testcase-minimized-6270352105668608 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/aac: Add floating point 960/120 MDCT windowPaul B Mahol2017-08-241-7/+117
| | | | | Co-Authored-By: Alex Converse <alex.converse@gmail.com> Co-Authored-By: Rostislav Pehlivanov <atomnuker@gmail.com>
* avcodec/aacdec_template: Fix running cleanup in decode_ics_info()Michael Niedermayer2017-08-221-4/+9
| | | | | | | | | | Fixes: out of array read Fixes: 2873/clusterfuzz-testcase-minimized-5924145713905664 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Previous version reviewed-by: Alex Converse <alex.converse@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/aacdec: Fix PCE channel_layout verificationNicolas Sugino2017-08-091-1/+1
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/aacdec_template (fixed point): Check gain in decode_cce() to avoid ↵Michael Niedermayer2017-07-181-0/+8
| | | | | | | | | | undefined shifts later Fixes: runtime error: shift exponent 47 is too large for 32-bit type 'int' Fixes: 2581/clusterfuzz-testcase-minimized-4681474395602944 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/aacdec_template: Fix undefined integer overflow in apply_tns()Michael Niedermayer2017-07-161-2/+3
| | | | | | | | Fixes: runtime error: signed integer overflow: -2147483648 - 1202286525 cannot be represented in type 'int' Fixes: 2071/clusterfuzz-testcase-minimized-6036414271586304 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* aacdec_template: fix non-power-of-two MDCT scale signRostislav Pehlivanov2017-07-121-1/+1
| | | | Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
* mdct15: remove redundant scale argument to imdct_halfRostislav Pehlivanov2017-07-111-2/+2
| | | | | | | The only use of that argument was for Opus downmixing which is very rare and better done after the mdcts. Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
* avcodec/aacsbr_fixed: Fix multiple runtime error: left shift of negative ↵Michael Niedermayer2017-05-191-2/+2
| | | | | | | | | | value -407 Fixes: 1674/clusterfuzz-testcase-minimized-6092531563495424 Fixes: 1686/clusterfuzz-testcase-minimized-6282691643179008 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/aacdec_template: Fix fixed point scale in decode_cce()Michael Niedermayer2017-05-171-1/+5
| | | | | | | | Fixes: runtime error: shift exponent 1073741824 is too large for 32-bit type 'int' Fixes: 1654/clusterfuzz-testcase-minimized-5151903795118080 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/aacdec_fixed: Fix various integer overflowsMichael Niedermayer2017-05-111-2/+2
| | | | | | | Fixes: 1377/clusterfuzz-testcase-minimized-5487049807233024 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/aacdec_template: Do not decode 2nd PCE if it will lead to failureMichael Niedermayer2017-05-071-2/+12
| | | | | | | | | Fixes: out of array read Fixes: 1072/clusterfuzz-testcase-6456688074817536 Fixes: 1398/clusterfuzz-testcase-minimized-4576913622302720 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* aacdec: do not mutate input packet metadatawm42017-03-091-6/+2
| | | | | | | | | | | | | | | | | Apparently the demuxer outputs the wrong padding for HE-AAC (based on the raw sample rate, or so). aacdec contains a hack to adjust the muxer padding accordingly before it's used to trim the decoder output. This modified the packet side data, which in combination with the old decoding API would change the packet the user passed to the decoder. This is clearly not allowed, and it breaks running some gapless fate tests with "-fflags +keepside" applied (without keepside, the packet metadata is typically newly allocated, essentially making a copy and not modifying the user's input packet). This should probably be fixed in the demuxer (and consequently also the muxer), but for now only fix the immediate problem. Regression since 946ed78f5f8 (2012).
* aacdec: When ignoring a PCE restore the previous configAlex Converse2017-02-211-0/+1
| | | | This is related to, but doesn't solve ticker 6152.
* imdct15: rename to mdct15 and add a forward transformRostislav Pehlivanov2017-02-141-2/+2
| | | | | | | Handles strides (needed for Opus transients), does pre-reindexing and folding without needing a copy. Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
* aac_latm: Align inband PCE to the start of the payloadAlex Converse2017-02-131-1/+4
| | | | | | | | | | | A strict reading of the spec seems to imply that it should be aligned to the start of the element instance tag, but that would break all of the samples with PCEs. It seems like a well formed LATM stream should have its PCE in the ASC rather than inband. Fixes ticket 4544
* aacsbr: Associate SBR data with AAC elements on initAlex Converse2017-02-131-1/+1
| | | | | | Quiets some log spam on pure upsampling mode. Fixes ticket 5163.
* aac_latm: Allow unaligned AudioSpecificConfigAlex Converse2017-02-131-30/+52
| | | | Fixes ticket 4730
* aacdec: Rename elem_type_prev to che_prev_type.Alex Converse2016-12-081-4/+4
| | | | | It describes the type of the previous che element (SCE, CPE, CCE, or LFE) and does not reflect non-che elements.
* aacdec: Allow SBR after DRC.Alex Converse2016-12-081-2/+4
| | | | | | Fixes https://www2.iis.fraunhofer.de/AAC/7.1auditionOutLeader_v2_rtb.mp4 Reported-by: rcombs on IRC
* lavc: Remove CR/LF from avpriv_request_sample() calls.Carl Eugen Hoyos2016-12-031-1/+1
|
* Move cbrt tables to separate cbrt_data(_fixed).c files.Reimar Döffinger2016-03-131-2/+2
| | | | | | Allows sharing and reusing the data between different files. Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
* avcodec/aacdec_template: Check id_mapMichael Niedermayer2016-01-101-0/+4
| | | | | | | | Fixes index out of bounds error Fixes: aac_index_out_of_bounds.wmv Found-by: Piotr Bandurski <ami_stuff@o2.pl> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* Merge commit '2c6811397bdf13d43ca206e48d6d6da9c2cd47c6'Hendrik Leppkes2016-01-011-12/+0
| | | | | | | * commit '2c6811397bdf13d43ca206e48d6d6da9c2cd47c6': lavc: add profiles to AVCodecDescriptor Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
* aac: temporarily un-share aac_table_init AVOnce variableRostislav Pehlivanov2015-11-271-0/+2
| | | | | | | AAC-Fixed decoder segfaulted. This commit makes the aac encoder and decoder init the table twice in case of transcoding again. Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
* aacenc: make threadsafeRostislav Pehlivanov2015-11-271-3/+1
| | | | | | | | Since the ff_aac_tableinit() can be called by both the encoder and the decoder (in case of transcoding) this commit shares the AVOnce variable to prevent this. Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
* aacdec: don't return frames without data from aac_decode_er_frameAndreas Cadhalpun2015-11-101-0/+5
| | | | | | | This is similar to commit ec38a1b for aac_decode_frame_int. Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com> Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
* aacdec: fix strict prototype warningHendrik Leppkes2015-10-211-1/+1
| | | | | Function protoypes without arguments require a void argument in C, instead of an empty list.
* aac: Make codec init run under ff_thread_onceDerek Buitenhuis2015-10-151-34/+46
| | | | | | This makes AAC init threadsafe. Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
* avcodec/aacdec: Fix integer overflow in argument to ↵Michael Niedermayer2015-08-031-4/+9
| | | | | | decode_audio_specific_config() Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* libavcodec/aacdec_template: Use init_get_bits8() in aac_decode_frame()Emanuel Czirai2015-08-031-1/+1
| | | | | | related to ticket4749 Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/aacdec_fixed: Fix preparation for resamplerNedeljko Babic2015-07-291-1/+2
| | | | | | | | | | | | 2nd channel makes sense only for CPE type. Skip 2nd channel in preparation for resampler (in spectral_to _sample()) depending on block type. Fixes fate failure with clang ftrapv. Signed-off-by: Nedeljko Babic <nedeljko.babic@imgtec.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/aac_fixed: Fix a bug in spectral_to_sample()Nedeljko Babic2015-07-281-5/+5
| | | | | | | | | | | | | | There was fixed number of loops (2048) in preparation for resampler, so when number of samples is smaller than this, there would be an overflow on ret_buf. For some reason this behavior popped out only under valgrind with --disable-memory-poisoning option. This is now fixed and number of loops depends on actual number of samples. Signed-off-by: Nedeljko Babic <nedeljko.babic@rt-rk.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* Merge commit '059a934806d61f7af9ab3fd9f74994b838ea5eba'Michael Niedermayer2015-07-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit '059a934806d61f7af9ab3fd9f74994b838ea5eba': lavc: Consistently prefix input buffer defines Conflicts: doc/examples/decoding_encoding.c libavcodec/4xm.c libavcodec/aac_adtstoasc_bsf.c libavcodec/aacdec.c libavcodec/aacenc.c libavcodec/ac3dec.h libavcodec/asvenc.c libavcodec/avcodec.h libavcodec/avpacket.c libavcodec/dvdec.c libavcodec/ffv1enc.c libavcodec/g2meet.c libavcodec/gif.c libavcodec/h264.c libavcodec/h264_mp4toannexb_bsf.c libavcodec/huffyuvdec.c libavcodec/huffyuvenc.c libavcodec/jpeglsenc.c libavcodec/libxvid.c libavcodec/mdec.c libavcodec/motionpixels.c libavcodec/mpeg4videodec.c libavcodec/mpegvideo.c libavcodec/noise_bsf.c libavcodec/nuv.c libavcodec/nvenc.c libavcodec/options.c libavcodec/parser.c libavcodec/pngenc.c libavcodec/proresenc_kostya.c libavcodec/qsvdec.c libavcodec/svq1enc.c libavcodec/tiffenc.c libavcodec/truemotion2.c libavcodec/utils.c libavcodec/utvideoenc.c libavcodec/vc1dec.c libavcodec/wmalosslessdec.c libavformat/adxdec.c libavformat/aiffdec.c libavformat/apc.c libavformat/apetag.c libavformat/avidec.c libavformat/bink.c libavformat/cafdec.c libavformat/flvdec.c libavformat/id3v2.c libavformat/isom.c libavformat/matroskadec.c libavformat/mov.c libavformat/mpc.c libavformat/mpc8.c libavformat/mpegts.c libavformat/mvi.c libavformat/mxfdec.c libavformat/mxg.c libavformat/nutdec.c libavformat/oggdec.c libavformat/oggparsecelt.c libavformat/oggparseflac.c libavformat/oggparseopus.c libavformat/oggparsespeex.c libavformat/omadec.c libavformat/rawdec.c libavformat/riffdec.c libavformat/rl2.c libavformat/rmdec.c libavformat/rtpdec_latm.c libavformat/rtpdec_mpeg4.c libavformat/rtpdec_qdm2.c libavformat/rtpdec_svq3.c libavformat/sierravmd.c libavformat/smacker.c libavformat/smush.c libavformat/spdifenc.c libavformat/takdec.c libavformat/tta.c libavformat/utils.c libavformat/vqf.c libavformat/westwood_vqa.c libavformat/xmv.c libavformat/xwma.c libavformat/yop.c Merged-by: Michael Niedermayer <michael@niedermayer.cc>
* Merge commit '7c6eb0a1b7bf1aac7f033a7ec6d8cacc3b5c2615'Michael Niedermayer2015-07-271-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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>
* avcodec/aactab: Add ff_aac_eld_window_480_fixedMichael Niedermayer2015-07-251-1/+1
| | | | | | Fixes pointer type mismatch Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec: Implementation of AAC_fixed_decoder (SBR-module)Djordje Pesut2015-07-201-7/+7
| | | | | | | Add fixed poind code. Signed-off-by: Nedeljko Babic <nedeljko.babic@imgtec.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
OpenPOWER on IntegriCloud