summaryrefslogtreecommitdiff
path: root/libavcodec/wavpackenc.c
Commit message (Collapse)AuthorAge
* wavpackenc: reset trailer info on block encodingChristophe Gisquet2014-08-22
| | | | | | | | | | | In some cases, in particular if several blocks are needed because of the channel layout (e.g. 2.1), the information used to write the trailing bits terminating the sample data was not reset. This would cause potential desync on the decoder, although decoded samples were actually mostly fine. Fixes ticket #3879.
* wavpackenc: make assert more thoroughChristophe Gisquet2014-08-22
| | | | | | | It was only validating that normal data wasn't filling the buffer. However, extra data may be written afterwards. Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* wavpackenc: fix number of samples per blockChristophe Gisquet2014-08-22
| | | | | | | | | | Currently, the encoder will try to reduce it down to 150000, but the decoder will complain starting at 131072 (WV_MAX_SAMPLES). Therefore, change the loop limit. Fixes ticket #3881. Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* wavpackenc: assert on too small bufferChristophe Gisquet2014-08-21
| | | | | | | | bytestream2_* will not cause buffer overflow, but in that case, this means the allocation would be incorrect and the encoded result invalid. Therefore, assert no overflow occurred. Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* wavpackenc: proper buffer allocationChristophe Gisquet2014-08-19
| | | | | | | | | | | The allocation didn't account for headers, that can be easily 79 bytes. As a result, buffers allocated for a few samples (e.g. 5 in the original bug) could be undersized. Fixed ticket #2881. Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* avcodec/wavpackenc: Fix log2sample() result valueMichael Niedermayer2014-08-02
| | | | | | Found-by: CSA Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* avcodec/wavpackenc: fix () in macrosMichael Niedermayer2014-06-20
| | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* avcodec/wavpackenc: fix uninitialized retMichael Niedermayer2013-10-20
| | | | | | Fixes CID1108609 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* wavpackenc: do not copy samples if they are not availablePaul B Mahol2013-08-17
| | | | Signed-off-by: Paul B Mahol <onemda@gmail.com>
* wavpackenc: simplify "sign = ((sample) < 0) ? 1 : 0;"Michael Niedermayer2013-08-14
| | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* WavPack encoderPaul B Mahol2013-08-14
Signed-off-by: Paul B Mahol <onemda@gmail.com>