/* subtract offset from previous samples to use in prediction */
if (command == FN_QLPC && coffset)
for (i = -pred_order; i < 0; i++)
- s->decoded[channel][i] -= coffset;
+ s->decoded[channel][i] -= (unsigned)coffset;
/* decode residual and do LPC prediction */
init_sum = pred_order ? (command == FN_QLPC ? s->lpcqoffset : 0) : coffset;
/* add offset to current samples */
if (command == FN_QLPC && coffset)
for (i = 0; i < s->blocksize; i++)
- s->decoded[channel][i] += coffset;
+ s->decoded[channel][i] += (unsigned)coffset;
return 0;
}
}
skip_bytes = get_uint(s, NSKIPSIZE);
- if ((unsigned)skip_bytes > get_bits_left(&s->gb)/8) {
+ if ((unsigned)skip_bytes > FFMAX(get_bits_left(&s->gb), 0)/8) {
av_log(s->avctx, AV_LOG_ERROR, "invalid skip_bytes: %d\n", skip_bytes);
return AVERROR_INVALIDDATA;
}
.init = shorten_decode_init,
.close = shorten_decode_close,
.decode = shorten_decode_frame,
- .capabilities = AV_CODEC_CAP_SUBFRAMES | AV_CODEC_CAP_DELAY | AV_CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_CHANNEL_CONF |
+ AV_CODEC_CAP_DELAY |
+ AV_CODEC_CAP_DR1 |
+ AV_CODEC_CAP_SUBFRAMES ,
.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S16P,
AV_SAMPLE_FMT_U8P,
AV_SAMPLE_FMT_NONE },
+ .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE,
};