summaryrefslogtreecommitdiff
path: root/libavcodec/mpegaudiodec_template.c
Commit message (Collapse)AuthorAge
* avcodec/mpegaudiodec*: Cleanup generically on init failureAndreas Rheinhardt2020-09-19
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/mpegaudiodec_float: Avoid indirection with float dsp functionAndreas Rheinhardt2020-09-19
| | | | | | | | Do this by only keeping the only function pointer from the AVFloatDSPContext that is needed lateron. This also allows to remove the decoders' close function. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/mpegaudiodec_template: Check return value of subdecoderAndreas Rheinhardt2020-09-19
| | | | | | After all, allocating an AVFloatDSPContext might have failed. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/mpegaudiodec_template: Fix some whitespace issuesMichael Niedermayer2020-08-06
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/mpegaudiodec_template: Check CRCs for layer1 and layer2Michael Niedermayer2020-08-04
| | | | | | | | | | | This differs from the MPEG specification as the actual real world files do compute their CRC over variable areas and not the fixed ones listed in the specification. This is also the reason for the complexity of this code and the need to perform the CRC check for layer2 in the middle of layer2 decoding. Reviewed-by: Lynne <dev@lynne.ee> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/mpegaudiodec_template: disable CRC checking for layers 1 and 2James Almer2020-08-03
| | | | | | | | | | Layers 1 and 2 use lengths in bits which are not a multiple of 8, and our CRC works on a per-byte basis. Based on b48397e7b8 Reviewed-by: Lynne <dev@lynne.ee> Signed-off-by: James Almer <jamrial@gmail.com>
* Revert "mpegaudiodec_template: disable CRC checking for layers 1 and 2"James Almer2020-08-03
| | | | | | | | | | | This reverts commit b48397e7b84864f2d4c70361a4c4bed93e826753. The change did not disable crc checks for layer 1 & 2, it removed reading the CRC field. Fixes decoding some mp2 samples and FATE test failures. Signed-off-by: James Almer <jamrial@gmail.com>
* mpegaudiodec_template: disable CRC checking for layers 1 and 2Lynne2020-08-02
| | | | | Layers 1 and 2 use lengths in bits which are not a multiple of 8, and our CRC works on a per-byte basis.
* 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>