summaryrefslogtreecommitdiffstats
path: root/libavcodec/smacker.c
Commit message (Collapse)AuthorAgeFilesLines
* smacker: limit recursion depth of smacker_decode_bigtreeAndreas Cadhalpun2017-11-101-4/+11
| | | | | | | | | This fixes segmentation faults due to stack-overflow caused by too deep recursion. Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com> Signed-off-by: Sean McGovern <gseanmcg@gmail.com>
* smacker: add sanity check for length in smacker_decode_tree()Michael Niedermayer2017-11-101-1/+6
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at> Bug-Id: 1098 Cc: libav-stable@libav.org Signed-off-by: Sean McGovern <gseanmcg@gmail.com>
* smacker: Improve error handlingDiego Biurrun2017-06-011-23/+24
| | | | Return sensible error values and forward error codes.
* smacker: Check that the data size is a multiple of a sample vectorMichael Niedermayer2017-06-011-0/+5
| | | | | | | | | | | | | Fixes out of array access Fixes: ce19e41f0ef1e52a23edc488faecdb58/asan_heap-oob_2504e97_4202_ffa0df1baed14022b9bfd4f8ac23d0cb.smk Bug-Id: CVE-2015-8365 CC: libav-stable@libav.org Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit 4a9af07a49295e014b059c1ab624c40345af5892) Signed-off-by: Diego Biurrun <diego@biurrun.de>
* vlc: Add header #include when the types are usedLuca Barbato2017-05-021-0/+1
| | | | | | Do not rely on indirectly including it from bitstream.h. Signed-off-by: Diego Biurrun <diego@biurrun.de>
* Use bitstream_init8() where appropriateDiego Biurrun2017-02-071-3/+3
|
* smacker: Convert to the new bitstream readerAlexandra Hájková2016-11-241-68/+75
|
* get_bits: Move BITSTREAM_READER_LE definition before all relevant #includesDiego Biurrun2016-06-071-4/+4
| | | | | | | This avoids the danger that get_bits.h might get indirectly #included before BITSTREAM_READER_LE is defined. Also sort headers into canonical order where appropriate.
* cosmetics: Drop particularly redundant silly commentsDiego Biurrun2016-02-181-14/+1
|
* lavc: AV-prefix all codec capabilitiesVittorio Giovara2015-07-271-2/+2
| | | | | | Express bitfields more simply. Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
* smacker: use the AVFrame API properly.Anton Khirnov2013-11-161-16/+19
|
* cosmetics: Group .name and .long_name together in codec/format declarationsDiego Biurrun2013-10-031-2/+2
|
* smacker: Free memory properly if the init function failsMartin Storsjö2013-09-111-21/+23
| | | | Signed-off-by: Martin Storsjö <martin@martin.st>
* smacker: Make sure we don't fill in huffman codes out of rangeMartin Storsjö2013-09-111-0/+6
| | | | | | Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind CC: libav-stable@libav.org Signed-off-by: Martin Storsjö <martin@martin.st>
* smacker: Check malloc return valuesMartin Storsjö2013-09-111-14/+35
| | | | | | Also try to free local allocations on errors. Signed-off-by: Martin Storsjö <martin@martin.st>
* smacker: check the return value of smacker_decode_treeKostya Shishkov2013-06-161-1/+10
| | | | | | | | | Also prevent a memory leak. Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind CC: libav-stable@libav.org Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
* smacker: fix an off by one in huff.length computationKostya Shishkov2013-06-161-1/+1
| | | | | | | Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind CC: libav-stable@libav.org Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
* smacker: add a clarification notice about audio decodingKostya Shishkov2013-05-281-0/+1
|
* Revert "smackaud: clip output samples"Kostya Shishkov2013-05-271-4/+4
| | | | | | Smacker audio uses overflows instead of clipping. This reverts commit 375ca0aca81be2951d9ba4731196e70e490d3cdf.
* lavc decoders: properly initialize AVFrame.Anton Khirnov2013-03-081-1/+1
|
* lavc decoders: work with refcounted frames.Anton Khirnov2013-03-081-9/+8
|
* smackaud: decode directly to the user-provided AVFrameJustin Ruggles2013-02-121-17/+6
|
* lavc: fix decode_frame() third parameter semantics for video decodersAnton Khirnov2012-12-041-2/+3
| | | | It's got_frame, not data size
* lavc: add a wrapper for AVCodecContext.get_buffer().Anton Khirnov2012-12-041-1/+2
| | | | It will be useful in the upcoming transition to refcounted AVFrames.
* Include libavutil/channel_layout.h instead of libavutil/audioconvert.hJustin Ruggles2012-11-111-1/+1
| | | | Also reorder some other #include when applicable.
* Replace PIX_FMT_* -> AV_PIX_FMT_*, PixelFormat -> AVPixelFormatAnton Khirnov2012-10-081-1/+1
|
* Replace all CODEC_ID_* with AV_CODEC_ID_*Anton Khirnov2012-08-071-2/+2
|
* smacker: remove some unused codeMans Rullgard2012-07-011-5/+1
| | | | | | | This removes some code apparently left over from vlc reader debugging. Signed-off-by: Mans Rullgard <mans@mansr.com>
* cosmetics: Align codec declarationsMartin Storsjö2012-04-061-2/+2
| | | | | | | Also break some long lines, remove codec function placeholder comments and add spaces in sample/pixel format lists. Signed-off-by: Martin Storsjö <martin@martin.st>
* smacker audio: sign-extend the initial 16-bit predicted valueFranz Brauße2012-03-301-1/+1
| | | | | | Fixes Bug #265 Signed-off-by: Justin Ruggles <justin.ruggles@gmail.com>
* Replace memset(0) by zero initializations.Diego Biurrun2012-03-281-8/+3
| | | | Also remove one pointless zero initialization in rangecoder.c.
* smacker: convert palette and header reading to bytestream2.Ronald S. Bultje2012-03-251-10/+10
|
* vlc/rl: Add ff_ prefix to the nonstatic symbolsMartin Storsjö2012-02-151-3/+3
| | | | Signed-off-by: Martin Storsjö <martin@martin.st>
* cosmetics: Remove extra newlines at EOFAlex Converse2012-01-271-1/+0
|
* smacker: Sanity check huffman tables found in the headers.Alex Converse2012-01-261-9/+13
| | | | | | Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind CC: libav-stable@libav.org
* smacker: remove dead storeAlex Converse2012-01-261-3/+1
|
* Drop ALT_ prefix from BITSTREAM_READER_LE name.Diego Biurrun2011-12-221-1/+1
| | | | | The prefix is a historic remnant that probably meant "alternative". Now that the A32 bitstream reader has been dropped it makes no sense anymore.
* Add avcodec_decode_audio4().Justin Ruggles2011-12-021-10/+31
| | | | | | Deprecate avcodec_decode_audio3(). Implement audio support in avcodec_default_get_buffer(). Implement the new audio decoder API in all audio decoders.
* smackaud: use uint8_t* for 8-bit output buffer typeJustin Ruggles2011-11-091-1/+1
| | | | This matches the output sample format and the range of the output values.
* smackaud: clip output samplesJustin Ruggles2011-11-091-4/+4
|
* smackaud: use sign_extend() for difference value instead of castingJustin Ruggles2011-11-091-4/+5
|
* smacker: validate channels and sample format.Justin Ruggles2011-10-111-0/+8
|
* smacker: check buffer size before reading output sizeJustin Ruggles2011-10-111-0/+5
|
* smacker: validate number of channelsJustin Ruggles2011-10-111-0/+4
|
* smacker: fix a few off by 1 errorsMichael Niedermayer2011-09-141-4/+4
| | | | | | stereo & 16bit is untested due to lack of samples Signed-off-by: Martin Storsjö <martin@martin.st>
* Check for invalid VLC value in smacker decoder.Laurent Aimar2011-09-141-0/+2
| | | | Signed-off-by: Martin Storsjö <martin@martin.st>
* Check and propagate errors when VLC trees cannot be built in smacker decoder.Laurent Aimar2011-09-141-8/+12
| | | | Signed-off-by: Martin Storsjö <martin@martin.st>
* lavc: use designated initialisers for all codecs.Anton Khirnov2011-07-291-17/+13
| | | | It's more readable and less prone to breakage.
* Replace deprecated FF_*_TYPE symbols with AV_PICTURE_TYPE_*.Stefano Sabatini2011-05-021-2/+2
| | | | Signed-off-by: Diego Biurrun <diego@biurrun.de>
* smacker: remove unnecessary call to avctx->release_buffer in decode_frame()Stefano Sabatini2011-04-271-2/+0
| | | | | | | | | The release_buffer was cleaning the provided frame, thus causing the successive call to avctx->reget_buffer() to allocate a new frame. In case the returned frame was not the same one previously returned but a new one with different data, it resulted in artifacts. Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
OpenPOWER on IntegriCloud