summaryrefslogtreecommitdiff
path: root/libavcodec/apedec.c
Commit message (Collapse)AuthorAge
* avcodec/apedec: Fix integer overflowMichael Niedermayer2017-07-16
| | | | | | | | Fixes: out of array access Fixes: PoC.ape and others Found-by: Bingchang, Liu@VARAS of IIE Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* Fix all -Wformat warnings raised by DJGPPClément Bœsch2017-03-29
|
* 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>
| * ape: Unbreak adaptcoeffs computationLuca Barbato2016-04-24
| | | | | | | | | | | | And simplify and explain the expression. Fault introduced in f3fdef108eb06b1e71b29152bf6822519e787efe
* | ape: Unbreak adaptcoeffs computationLuca Barbato2016-05-12
| | | | | | | | | | | | | | | | And simplify and explain the expression. Fault introduced in f3fdef108eb06b1e71b29152bf6822519e787efe Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
* | Merge commit 'f3fdef108eb06b1e71b29152bf6822519e787efe'Derek Buitenhuis2016-05-12
|\| | | | | | | | | | | | | * commit 'f3fdef108eb06b1e71b29152bf6822519e787efe': ape: Avoid undefined behaviour Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
| * ape: Avoid undefined behaviourLuca Barbato2016-04-19
| | | | | | | | | | | | Avoid the clang warning "warning: shifting a negative signed value is undefined"
* | avcodec/apedec: fix decoding of stereo files with one channel full of silencePaul B Mahol2016-04-12
| | | | | | | | Signed-off-by: Paul B Mahol <onemda@gmail.com>
* | ape: Show more information for loglevel verbose.Carl Eugen Hoyos2016-01-19
| | | | | | | | Requested by Andy E, fixes bug 687.
* | avcodec/apedec: Check length in long_filter_high_3800()Michael Niedermayer2015-12-02
| | | | | | | | | | | | | | | | Fixes out of array read Fixes: 0a7ff0c1d93da9cef28a315ec91b692a/asan_heap-oob_4a52e5_3604_9c56dbb20e308f4faeef7b35f688521a.ape Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avcodec/apedec: fix bug introduced in commit ↵Ganesh Ajjanagadde2015-10-03
| | | | | | | | | | | | | | d3e5fbb1406995e07fccbff3ca8c1e24f57a1f7b Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avcodec/apedec: fix undefined left shifts of negative numbersGanesh Ajjanagadde2015-09-29
| | | | | | | | | | | | | | | | | | | | This fixes -Wshift-negative-value reported with clang 3.7+, e.g http://fate.ffmpeg.org/log.cgi?time=20150919172459&log=compile&slot=x86_64-darwin-clang-polly-notiling-3.7. Note that the patch crucially depends on int >= 32 bits, an assumption made in many places in the codebase. Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | 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>
| * ape: Support _0000 files with nblock smaller than 64Andreas Cadhalpun2015-05-08
| | | | | | | | | | | | | | | | The decode_array_0000 assumed that 64 is the minimal block size while it is not. CC: libav-stable@libav.org Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
* | apedec: prevent out of array writes in decode_array_0000Andreas Cadhalpun2015-04-28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | s->decoded_buffer is allocated with a min_size of: 2 * FFALIGN(blockstodecode, 8) * sizeof(*s->decoded_buffer) Then it is assigned to s->decoded[0] (and s->decoded_buffer + FFALIGN(blockstodecode, 8) to s->decoded[1]) and passed as out buffer to decode_array_0000. In this function 64 elements of the out buffer are written unconditionally and outside the array if blockstodecode is too small. This causes memory corruption, leading to segmentation faults or other crashes. Thus change decode_array_0000 to write at most blockstodecode elements of the out buffer. Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | apedec: set s->samples only when init_frame_decoder succeededAndreas Cadhalpun2015-04-28
| | | | | | | | | | | | | | | | | | Otherwise range_start_decoding is not necessarily run and thus ctx->rc.range still 0 in range_dec_normalize leading to an infinite loop. Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avcodec/apedec: simplify sign conversionzhaoxiu.zeng2015-02-14
| | | | | | | | | | Signed-off-by: Zeng Zhaoxiu <zhaoxiu.zeng@gmail.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avcodec/apedec: move 'coeffs[256] and delay[256]' into, long_filter_high_3800zhaoxiu.zeng2015-02-13
| | | | | | | | | | Signed-off-by: Zeng Zhaoxiu <zhaoxiu.zeng@gmail.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge commit 'c67b449bebbe0b35c73b203683e77a0a649bc765'Michael Niedermayer2014-06-23
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit 'c67b449bebbe0b35c73b203683e77a0a649bc765': dsputil: Split bswap*_buf() off into a separate context Conflicts: configure libavcodec/4xm.c libavcodec/ac3dec.c libavcodec/ac3dec.h libavcodec/apedec.c libavcodec/eamad.c libavcodec/flacenc.c libavcodec/fraps.c libavcodec/huffyuv.c libavcodec/huffyuvdec.c libavcodec/motionpixels.c libavcodec/truemotion2.c libavcodec/x86/Makefile libavcodec/x86/dsputil_init.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * dsputil: Split bswap*_buf() off into a separate contextDiego Biurrun2014-06-22
| |
* | avcodec/apedec: optimize sign combinationMichael Niedermayer2014-06-23
| | | | | | | | | | | | 48078630 -> 32533850 dezi cycles Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge commit 'f83896abda1e78ebbbda0f184b682b4fabadc682'Michael Niedermayer2014-06-23
|\| | | | | | | | | | | | | * commit 'f83896abda1e78ebbbda0f184b682b4fabadc682': ape: Replace memset(0) by zero initialization Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * ape: Replace memset(0) by zero initializationDiego Biurrun2014-06-22
| |
* | apedsp: move to llauddspChristophe Gisquet2014-06-05
| | | | | | | | | | | | APE is not the sole codec using scalarproduct_and_madd_int16. Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge commit '054013a0fc6f2b52c60cee3e051be8cc7f82cef3'Michael Niedermayer2014-05-30
|\| | | | | | | | | | | | | | | | | | | | | * commit '054013a0fc6f2b52c60cee3e051be8cc7f82cef3': dsputil: Move APE-specific bits into apedsp Conflicts: libavcodec/arm/int_neon.S libavcodec/x86/dsputil.asm Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * dsputil: Move APE-specific bits into apedspDiego Biurrun2014-05-29
| |
* | avcodec/apedec: tmpk==32 is not supported, prevent undefined behaviorMichael Niedermayer2014-04-26
| | | | | | | | | | Fixes CID1206639 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/apedec: use av_fast_padded_malloc()Michael Niedermayer2013-12-23
| | | | | | | | | | | | | | Fixes use of uninitialized memory Fixes part of msan_uninit-mem_7fa0d8c8bd58_8417_sh3.ape Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avcodec/apedec: more checks for kMichael Niedermayer2013-12-23
| | | | | | | | | | | | | | Fixes assertion failure Fixes part of msan_uninit-mem_7fa0d8c8bd58_8417_sh3.ape Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avcodec/apedec: use init_get_bits8()Paul B Mahol2013-10-30
| | | | | | | | Signed-off-by: Paul B Mahol <onemda@gmail.com>
* | 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
| |
| * apedec: do not buffer decoded samples over AVPacketsRafaël Carré2013-08-28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Only consume an AVPacket when all the samples have been read. When the rate of samples output is limited (by the default value of max_samples), consuming the first packet immediately will cause timing problems: - The first packet with PTS 0 will output 4608 samples and be consumed entirely - The second packet with PTS 64 will output the remaining samples (typically, a lot, that's why max_samples exist) until the decoded samples of the first packet have been exhausted, at which point the samples of the second packet will be decoded and output when av_decode_frame is called with the next packet). That means there's a PTS jump since the first packet is 'decoded' immediately, which can be seen with avplay or mplayer: the timing jumps immediately to 6.2s (which is the size of a packet). Sample: http://streams.videolan.org/issues/6348/Goldwave-MAClib.ape Signed-off-by: Justin Ruggles <justin.ruggles@gmail.com>
* | ape_decode_value_3860: check k before using it in get_bits()Michael Niedermayer2013-05-02
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | ape_decode_value_3900: check tmpkMichael Niedermayer2013-05-02
| | | | | | | | | | | | | | Fixes division by 0 Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge commit '613a37eca4c7b8eefceaa3e0231c23ad090ca94f'Michael Niedermayer2013-03-26
|\| | | | | | | | | | | | | | | | | | | | | | | * commit '613a37eca4c7b8eefceaa3e0231c23ad090ca94f': ape: 3.80-3.92 decoding support h264: Remove an unused variable Conflicts: libavcodec/apedec.c libavformat/ape.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * ape: 3.80-3.92 decoding supportKostya Shishkov2013-03-25
| |
* | Merge remote-tracking branch 'qatar/master'Michael Niedermayer2013-03-15
|\| | | | | | | | | | | | | * qatar/master: add support for Monkey's Audio versions from 3.93 Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * add support for Monkey's Audio versions from 3.93Kostya Shishkov2013-03-15
| |
* | Merge commit '9652d4fcfc9c07a726b35efc4ac644d9751b36d7'Michael Niedermayer2013-03-15
|\| | | | | | | | | | | | | * commit '9652d4fcfc9c07a726b35efc4ac644d9751b36d7': ape: provide two additional bytes in buffer for old MAC versions Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * ape: provide two additional bytes in buffer for old MAC versionsKostya Shishkov2013-03-15
| | | | | | | | Range coder in 3.90-3.95 overread two bytes in the final normalize.
* | Merge commit 'b164d66e35d349de414e2f0d7365a147aba8a620'Michael Niedermayer2013-03-15
|\| | | | | | | | | | | | | | | * commit 'b164d66e35d349de414e2f0d7365a147aba8a620': ape: make version-dependent decoding functions called via pointers mpegts: add support for stream_type 0x42, which is CAVS Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * ape: make version-dependent decoding functions called via pointersKostya Shishkov2013-03-15
| | | | | | | | | | | | | | This will help in supporting old versions, e.g. version 3.93 uses the same range coder but different predictor and version 3.82 uses different range coder and predictor. Also this should not make decoding newer versions slower by introducing additional checks on versions.
* | Merge commit '6d97484d72e33f7dde9493a9ead1a72e2f029605'Michael Niedermayer2013-03-14
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | * commit '6d97484d72e33f7dde9493a9ead1a72e2f029605': avcodec: av_log_ask_for_sample() ---> avpriv_request_sample() rsodec: Use avpriv_report_missing_feature() where appropriate Conflicts: libavcodec/anm.c libavcodec/mlpdec.c libavcodec/pictordec.c libavcodec/sunrast.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * avcodec: av_log_ask_for_sample() ---> avpriv_request_sample()Diego Biurrun2013-03-13
| |
* | lavc: factorize ff_{thread_,re,}get_buffer error messages.Clément Bœsch2013-03-13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Coccinelle profile used: @@ expression r, ctx, f, loglevel, str, flags; @@ -if ((r = ff_get_buffer(ctx, f, flags)) < 0) { - av_log(ctx, loglevel, str); - return r; -} +if ((r = ff_get_buffer(ctx, f, flags)) < 0) + return r; @@ expression r, ctx, f, loglevel, str; @@ -if ((r = ff_reget_buffer(ctx, f)) < 0) { - av_log(ctx, loglevel, str); - return r; -} +if ((r = ff_reget_buffer(ctx, f)) < 0) + return r; @@ expression r, ctx, f, loglevel, str, flags; @@ -if ((r = ff_thread_get_buffer(ctx, f, flags)) < 0) { - av_log(ctx, loglevel, str); - return r; -} +if ((r = ff_thread_get_buffer(ctx, f, flags)) < 0) + return r; ...along with some manual patches for the remaining ones.