// initialize CRC calculation
if (sconf->crc_enabled) {
if (get_bits_left(&gb) < 32)
- return -1;
+ return AVERROR_INVALIDDATA;
- if (avctx->err_recognition & AV_EF_CRCCHECK) {
+ if (avctx->err_recognition & (AV_EF_CRCCHECK|AV_EF_CAREFUL)) {
ctx->crc_table = av_crc_get_table(AV_CRC_32_IEEE_LE);
ctx->crc = 0xFFFFFFFF;
ctx->crc_org = ~get_bits_long(&gb, 32);
*/
static int read_block(ALSDecContext *ctx, ALSBlockData *bd)
{
- GetBitContext *gb = &ctx->gb;
- int ret = 0;
+ int ret;
+ GetBitContext *gb = &ctx->gb;
*bd->shift_lsbs = 0;
// read block type flag and read the samples accordingly
if (get_bits1(gb)) {
- if ((ret = read_var_block_data(ctx, bd)) < 0)
- return ret;
+ ret = read_var_block_data(ctx, bd);
} else {
- read_const_block_data(ctx, bd);
+ if ((ret = read_const_block_data(ctx, bd)) < 0)
+ return ret;
}
- return 0;
+ return ret;
}
current->master_channel = get_bits_long(gb, av_ceil_log2(channels));
if (current->master_channel >= channels) {
- av_log(ctx->avctx, AV_LOG_ERROR, "Invalid master channel!\n");
+ av_log(ctx->avctx, AV_LOG_ERROR, "Invalid master channel.\n");
- return -1;
+ return AVERROR_INVALIDDATA;
}
if (current->master_channel != c) {
}
if (entries == channels) {
- av_log(ctx->avctx, AV_LOG_ERROR, "Damaged channel data!\n");
+ av_log(ctx->avctx, AV_LOG_ERROR, "Damaged channel data.\n");
- return -1;
+ return AVERROR_INVALIDDATA;
}
align_get_bits(gb);
}
if (dep == channels) {
- av_log(ctx->avctx, AV_LOG_WARNING, "Invalid channel correlation!\n");
+ av_log(ctx->avctx, AV_LOG_WARNING, "Invalid channel correlation.\n");
- return -1;
+ return AVERROR_INVALIDDATA;
}
bd->const_block = ctx->const_block + c;
for (c = 0; c < avctx->channels; c++)
if (ctx->chan_data[c] < ctx->chan_data_buffer) {
- av_log(ctx->avctx, AV_LOG_ERROR, "Invalid channel data!\n");
+ av_log(ctx->avctx, AV_LOG_ERROR, "Invalid channel data.\n");
- return -1;
+ return AVERROR_INVALIDDATA;
}
memset(reverted_channels, 0, sizeof(*reverted_channels) * avctx->channels);