From: Michael Niedermayer Date: Wed, 24 Jul 2013 08:28:38 +0000 (+0200) Subject: Merge commit 'ca488ad480360dfafcb5766f7bfbb567a0638979' X-Git-Tag: android-x86-4.4-r1~2215 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=a550926705fe29e1bc3c674ac302ef7912f02938;p=android-x86%2Fexternal-ffmpeg.git Merge commit 'ca488ad480360dfafcb5766f7bfbb567a0638979' * commit 'ca488ad480360dfafcb5766f7bfbb567a0638979': alsdec: Clean up error paths Conflicts: libavcodec/alsdec.c Merged-by: Michael Niedermayer --- a550926705fe29e1bc3c674ac302ef7912f02938 diff --cc libavcodec/alsdec.c index e8235437b7,b1e61b037c..038b1a870d --- a/libavcodec/alsdec.c +++ b/libavcodec/alsdec.c @@@ -399,9 -388,9 +399,9 @@@ static av_cold int read_specific_config // 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); @@@ -975,20 -960,18 +975,19 @@@ static int decode_var_block_data(ALSDec */ 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; } @@@ -1189,8 -1176,8 +1192,8 @@@ static int read_channel_data(ALSDecCont 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) { @@@ -1214,8 -1201,8 +1217,8 @@@ } 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); @@@ -1246,8 -1233,8 +1249,8 @@@ static int revert_channel_correlation(A } 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; @@@ -1374,8 -1363,8 +1379,8 @@@ static int read_frame_data(ALSDecContex 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);