summaryrefslogtreecommitdiff
path: root/libavcodec/mpegaudiodec_template.c
Commit message (Collapse)AuthorAge
* mpegaudiodec_template: add ability to check CRCLynne2020-05-26
| | | | | | A lot of files have CRC included. The CRC only covers 34 bytes at most from the frame but it should still be enough for some amount of error detection.
* avcodec: use avpriv_mpeg4audio_get_config2()James Almer2019-09-27
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* Fix all -Wformat warnings raised by DJGPPClément Bœsch2017-03-29
|
* Merge commit '255526998501f0040ae43fe4848c817a97fc578a'Clément Bœsch2017-03-24
|\ | | | | | | | | | | | | * commit '255526998501f0040ae43fe4848c817a97fc578a': mpegaudio: Do not print value of uninitialized variable Merged-by: Clément Bœsch <u@pkh.me>
| * mpegaudio: Do not print value of uninitialized variableDiego Biurrun2016-10-27
| | | | | | | | libavcodec/mpegaudiodec_template.c:885:97: warning: variable 'x' is uninitialized when used here [-Wuninitialized]
* | avcodec/mpegaudiodec_template: Fix 2 runtime error: signed integer overflowMichael Niedermayer2017-03-21
| | | | | | | | | | | | | | Fixes: 873/clusterfuzz-testcase-5714546230558720 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avcodec/mpegaudiodec_template: Make l3_unscale() work with e=0Michael Niedermayer2017-03-14
| | | | | | | | | | | | | | | | Fixes undefined behavior Fixes: 830/clusterfuzz-testcase-6253175327686656 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avcodec/mpegaudiodec_template: Check for negative eMichael Niedermayer2017-03-09
| | | | | | | | | | | | | | | | Fixes: undefined shift Fixes: 631/clusterfuzz-testcase-6725491035734016 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avcodec/mpegaudiodec_template: Fix runtime error: signed integer overflow: ↵Michael Niedermayer2017-03-03
| | | | | | | | | | | | | | | | | | 2053224902 + 2053224902 cannot be represented in type 'int' Fixes: 696/clusterfuzz-testcase-5853632270434304 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avcodec/mpegaudiodec_template: Correct return code on id3 tag discardingMichael Niedermayer2017-02-24
| | | | | | | | | | | | | | Fixes: 665/clusterfuzz-testcase-4863789881098240 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avcodec/mpegaudiodec_template: Fix multiple runtime error: signed integer ↵Michael Niedermayer2017-02-22
| | | | | | | | | | | | | | | | | | overflow Fixes: 648/clusterfuzz-testcase-5337961317007360 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avcodec/mpegaudiodec: Eliminate many undefined operationsMichael Niedermayer2017-02-20
| | | | | | | | | | | | | | | | Fixes: 625/clusterfuzz-testcase-4574924406521856 Fixes: 626/clusterfuzz-testcase-4738718621499392 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | mpegaudiodec_template: fix leaking fdsp for mp3on4floatAndreas Cadhalpun2017-02-17
| | | | | | | | | | Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
* | Merge commit '74b1bf632f125a795e66e5fd0a060b9c7c55b7a3'Hendrik Leppkes2016-06-26
|\| | | | | | | | | | | | | * commit '74b1bf632f125a795e66e5fd0a060b9c7c55b7a3': mp3: Make the extrasize explicit Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
| * mp3: Make the extrasize explicitLuca Barbato2016-05-22
| | | | | | | | | | | | | | | | | | Initialize the bit buffer with the correct size (amount of bits that will be read) instead of relying on the bitstream reader overreading the correct values. Signed-off-by: Luca Barbato <lu_zero@gentoo.org> Signed-off-by: Diego Biurrun <diego@biurrun.de>
* | 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>
| * lavc: Add get_bitsz()Andreas Cadhalpun2016-01-11
| | | | | | | | | | | | get_bit variant supporting 0-bits reads. Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
* | fix some a/an typosLou Logan2016-03-28
| | | | | | | | Signed-off-by: Lou Logan <lou@lrcd.com>
* | get_bits: add get_bitsz for reading 0-25 bitsAndreas Cadhalpun2016-01-03
| | | | | | | | | | | | | | This can be used to simplify code in a couple of places. Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
* | Merge commit '955aec3c7c7be39b659197e1ec379a09f2b7c41c'Hendrik Leppkes2016-01-01
|\| | | | | | | | | | | | | * commit '955aec3c7c7be39b659197e1ec379a09f2b7c41c': mpegaudiodecheader: check the header in avpriv_mpegaudio_decode_header Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
| * mpegaudiodecheader: check the header in avpriv_mpegaudio_decode_headerAnton Khirnov2015-12-12
| | | | | | | | | | | | Almost all the places from which this function is called already check the header manually and in the two that don't (the mp3 muxer) the check should not cause any problems.
* | mips: rename mipsdspr1 to mipsdspVicente Olivert Riera2015-12-04
| | | | | | | | | | Signed-off-by: Vicente Olivert Riera <Vincent.Riera@imgtec.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avcodec/mp3: fix skipping zeroswm42015-09-30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commits 43bc5cf9 and c5371f77 add code for skipping initial zeros in mp3 packets. This code forgot to report to the user that data was skipped at all. Since audio codecs allow partial packet decoding, the user application has to rely on the return value. It will remove the data reported as consumed by the decoder, and feed it to the decoder again. This resulted in the mp3 frame after the zero region to be decoded over and over again, until the zero region was finally skipped by the application. Fix this by including the amount of skipped bytes to the number of consumed bytes returned by the decode call. Fixes trac ticket #4890.
* | Merge commit '7c6eb0a1b7bf1aac7f033a7ec6d8cacc3b5c2615'Michael Niedermayer2015-07-27
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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-27
| | | | | | | | | | | | Convert doxygen to multiline and express bitfields more simply. Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
* | mpegaudiodec: copy AVFloatDSPContext from first context to all contextsAndreas Cadhalpun2015-06-26
| | | | | | | | | | | | | | | | | | This fixes a segfault when decoding multi-channel MP3onMP4 files. This is similar to commit cb72230d for MPADSPContext. Reviewed-by: Michael Niedermayer <michaelni@gmx.at> Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
* | Merge commit '6ec688e1bc76dd93151cbca1c340162ae4b10d77'Michael Niedermayer2015-06-21
|\| | | | | | | | | | | | | | | | | | | | | | | | | * commit '6ec688e1bc76dd93151cbca1c340162ae4b10d77': mp3: enable packed main_data decoding in MP4 Conflicts: libavcodec/mpegaudiodec_template.c Only the parts needed to support the available sample are merged the remaining error checks are left in place Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * mp3: enable packed main_data decoding in MP4nu7742015-06-20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 14496-3 suggests packing main_data of MP3 that is usually scattered into multiple frames due to bit reservoir. However, after packing main_data into a access unit, bitrate index in the MPEG audio frame header doesn't match with actual frame size. In order to accept this, this patch removes unnecessary frame size checking on mp3 decoder. Also, mov demuxer was changed to use MP3 parser only on special cases (QT MOV with specific sample description) to avoid re-packetizing. Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
* | Merge commit '6a85dfc830f51f1f5c2d36d4182d265c1ea3ba25'Michael Niedermayer2015-04-20
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit '6a85dfc830f51f1f5c2d36d4182d265c1ea3ba25': lavc: Replace av_dlog and tprintf with internal macros Conflicts: libavcodec/aacdec.c libavcodec/audio_frame_queue.c libavcodec/bitstream.c libavcodec/dcadec.c libavcodec/dnxhddec.c libavcodec/dvbsubdec.c libavcodec/dvdec.c libavcodec/dvdsubdec.c libavcodec/get_bits.h libavcodec/gifdec.c libavcodec/h264.h libavcodec/h264_cabac.c libavcodec/h264_cavlc.c libavcodec/h264_loopfilter.c libavcodec/h264_refs.c libavcodec/imc.c libavcodec/interplayvideo.c libavcodec/jpeglsdec.c libavcodec/libopencore-amr.c libavcodec/mjpegdec.c libavcodec/mpeg12dec.c libavcodec/mpegvideo_enc.c libavcodec/mpegvideo_parser.c libavcodec/pngdec.c libavcodec/ratecontrol.c libavcodec/rv10.c libavcodec/svq1dec.c libavcodec/vqavideo.c libavcodec/wmadec.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * lavc: Replace av_dlog and tprintf with internal macrosVittorio Giovara2015-04-19
| |
* | avcodec/mpegaudiodec_template: use double to build csa tablesMichael Niedermayer2015-04-17
| | | | | | | | | | | | | | Fixes rounding difference between 32bit x86 and 64bit Fixes fate failure with gapless mp3 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avcodec/mpegaudiodec_template: only allocate fdsp when its usedMichael Niedermayer2014-12-05
| | | | | | | | | | | | Fixes memleak Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avcodec/mpegaudiodec_float: Use avpriv_float_dsp_alloc()Michael Niedermayer2014-12-03
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avcodec/mpegaudiodec_template: use av_freep(), do not leave stale pointers ↵Michael Niedermayer2014-10-19
| | | | | | | | | | | | in memory Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Drop remaining unneeded != NULLMichael Niedermayer2014-08-15
| | | | | | | | | | Reviewed-by: Clément Bœsch <u@pkh.me> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge commit 'f929ab0569ff31ed5a59b0b0adb7ce09df3fca39'Michael Niedermayer2014-08-15
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit 'f929ab0569ff31ed5a59b0b0adb7ce09df3fca39': cosmetics: Write NULL pointer equality checks more compactly Conflicts: cmdutils.c ffmpeg_opt.c ffplay.c libavcodec/dvbsub.c libavcodec/dvdsubdec.c libavcodec/dvdsubenc.c libavcodec/dxa.c libavcodec/libxvid_rc.c libavcodec/mpegvideo.c libavcodec/mpegvideo_enc.c libavcodec/rv10.c libavcodec/tiffenc.c libavcodec/utils.c libavcodec/vc1dec.c libavcodec/zmbv.c libavdevice/v4l2.c libavformat/matroskadec.c libavformat/movenc.c libavformat/sdp.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * cosmetics: Write NULL pointer equality checks more compactlyGabriel Dume2014-08-15
| | | | | | | | Signed-off-by: Diego Biurrun <diego@biurrun.de>
* | avcodec/mpegaudiodec: Reset dither and mdct stateMichael Niedermayer2014-06-05
| | | | | | | | | | | | | | This makes the mp3 decoder produce the same result when repeatly flushing and decoding Suggested-by: Dale Curtis <dalecurtis@chromium.org> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avcodec/mpegaudiodec_template: make shift unsigned to avoid undefined behaviorMichael Niedermayer2014-05-09
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avcodec/mpegaudiodec_template: decode_frame_mp3on4: conceal errors in ↵Michael Niedermayer2014-01-14
| | | | | | | | | | | | decoding instead of discarding data Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avcodec/mpegaudiodec_template/mp3on4: check that all channels have been ↵Michael Niedermayer2014-01-14
| | | | | | | | | | | | | | | | | | decoded before returnig a frame Fixes use of uninitialized memory Fixes: msan_uninit-mem_7f80bf9a259e_5774_id5_1.mp4 Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | mp3on4: fail when the header check failsMichael Niedermayer2014-01-02
| | | | | | | | | | | | | | | | | | | | | | It seems the code assumed that when one out of multiple blocks fail some span of time is correct, its not, its some channels that are correct Fixes use of uninitialized memory Fixes: msan_uninit-mem_7f44a03ba3ce_5692_id5_1.mp4 Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge remote-tracking branch 'qatar/master'Michael Niedermayer2013-12-12
|\| | | | | | | | | | | | | * qatar/master: mp3adu: Set the channel layout properly Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * mp3adu: Set the channel layout properlyMartin Storsjö2013-12-12
| | | | | | | | | | | | | | | | | | This fixes decoding, broken since 7e35037. This is similar to what was done for the normal mp3 decoder in f4a86bc9. Signed-off-by: Martin Storsjö <martin@martin.st>
* | libavcodec/mpegaudio: change CONFIG_FLOAT to USE_FLOATMichael Niedermayer2013-12-03
| | | | | | | | | | | | | | | | The CONFIG_ name-space is set by configure, so its better to use a different prefix here. This also unifies the encoder & decoder define that is used Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge commit '0eeeb9647e9c92c9edfd0b18c7cb5da7ac666f85'Michael Niedermayer2013-11-24
|/ | | | | | | | | | * commit '0eeeb9647e9c92c9edfd0b18c7cb5da7ac666f85': mpegaudiodec: Consistently handle fixed/float templating Conflicts: libavcodec/Makefile Merged-by: Michael Niedermayer <michaelni@gmx.at>
* mpegaudiodec: Consistently handle fixed/float templatingDiego Biurrun2013-11-23