* @file
* Shorten decoder
* @author Jeff Muizelaar
- *
*/
#include <limits.h>
void *tmp_ptr;
s->max_framesize = 1024; // should hopefully be enough for the first header
tmp_ptr = av_fast_realloc(s->bitstream, &s->allocated_bitstream_size,
- s->max_framesize + FF_INPUT_BUFFER_PADDING_SIZE);
+ s->max_framesize + AV_INPUT_BUFFER_PADDING_SIZE);
if (!tmp_ptr) {
av_log(avctx, AV_LOG_ERROR, "error allocating bitstream buffer\n");
return AVERROR(ENOMEM);
break;
case FN_BITSHIFT:
s->bitshift = get_ur_golomb_shorten(&s->gb, BITSHIFTSIZE);
+ if (s->bitshift < 0)
+ return AVERROR_INVALIDDATA;
break;
case FN_BLOCKSIZE: {
unsigned blocksize = get_uint(s, av_log2(s->blocksize));
if (blocksize > s->blocksize) {
- av_log(avctx, AV_LOG_ERROR,
- "Increasing block size is not supported\n");
+ avpriv_report_missing_feature(avctx,
+ "Increasing block size");
return AVERROR_PATCHWELCOME;
}
if (!blocksize || blocksize > MAX_BLOCKSIZE) {
.init = shorten_decode_init,
.close = shorten_decode_close,
.decode = shorten_decode_frame,
- .capabilities = CODEC_CAP_DELAY | CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_DR1,
.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S16P,
AV_SAMPLE_FMT_NONE },
};