diff --git a/configure b/configure index 4ecb116b47..065a957a99 100755 --- a/configure +++ b/configure @@ -2015,14 +2015,13 @@ cxx_default="g++" host_cc_default="gcc" install="install" ln_s="ln -sf" -nm_default="nm" +nm_default="nm -g" objformat="elf" pkg_config_default=pkg-config ranlib="ranlib" strip_default="strip" yasmexe_default="yasm" -nm_opts='-g' nogas=":" # machine @@ -2309,7 +2308,7 @@ strip_default="${cross_prefix}${strip_default}" sysinclude_default="${sysroot}/usr/include" -set_default cc cxx nm pkg_config strip sysinclude yasmexe +set_default cc cxx pkg_config strip sysinclude yasmexe enabled cross_compile || host_cc_default=$cc set_default host_cc @@ -2988,7 +2987,7 @@ case $target_os in # guards for processor-specific code, instead suppress # generation of the HWCAPS ELF section on Solaris x86 only. enabled_all suncc x86 && echo "hwcap_1 = OVERRIDE;" > mapfile && add_ldflags -Wl,-M,mapfile - nm_opts='-P -g' + nm_default='nm -P -g' ;; netbsd) disable symver @@ -3191,6 +3190,7 @@ echo "config:$arch:$subarch:$cpu:$target_os:$(esc $cc_ident):$(esc $FFMPEG_CONFI check_cpp_condition stdlib.h "defined(__PIC__) || defined(__pic__) || defined(PIC)" && enable pic set_default $PATHS_LIST +set_default nm # we need to build at least one lib type if ! enabled_any static shared; then @@ -3244,7 +3244,7 @@ enabled pic && enable_pic check_cc <opt_order > sconf->max_order) { *bd->opt_order = sconf->max_order; av_log(avctx, AV_LOG_ERROR, "Predictor order too large!\n"); - return -1; + return AVERROR_INVALIDDATA; } } else { *bd->opt_order = sconf->max_order; @@ -706,7 +706,7 @@ static int read_var_block_data(ALSDecContext *ctx, ALSBlockData *bd) int offset = parcor_rice_table[sconf->coef_table][k][0]; quant_cof[k] = decode_rice(gb, rice_param) + offset; if (quant_cof[k] < -64 || quant_cof[k] > 63) { - av_log(avctx, AV_LOG_ERROR, "Quantization coefficient %d is out of range!\n", quant_cof[k]); + av_log(avctx, AV_LOG_ERROR, "quant_cof %d is out of range\n", quant_cof[k]); return AVERROR_INVALIDDATA; } } @@ -770,7 +770,6 @@ static int read_var_block_data(ALSDecContext *ctx, ALSBlockData *bd) int delta[8]; unsigned int k [8]; unsigned int b = av_clip((av_ceil_log2(bd->block_length) - 3) >> 1, 0, 5); - unsigned int i = start; // read most significant bits unsigned int high; @@ -781,29 +780,30 @@ static int read_var_block_data(ALSDecContext *ctx, ALSBlockData *bd) current_res = bd->raw_samples + start; - for (sb = 0; sb < sub_blocks; sb++, i = 0) { + for (sb = 0; sb < sub_blocks; sb++) { + unsigned int sb_len = sb_length - (sb ? 0 : start); + k [sb] = s[sb] > b ? s[sb] - b : 0; delta[sb] = 5 - s[sb] + k[sb]; - ff_bgmc_decode(gb, sb_length - i, current_res, + ff_bgmc_decode(gb, sb_len, current_res, delta[sb], sx[sb], &high, &low, &value, ctx->bgmc_lut, ctx->bgmc_lut_status); - current_res += sb_length - i; + current_res += sb_len; } ff_bgmc_decode_end(gb); // read least significant bits and tails - i = start; current_res = bd->raw_samples + start; - for (sb = 0; sb < sub_blocks; sb++, i = 0) { + for (sb = 0; sb < sub_blocks; sb++, start = 0) { unsigned int cur_tail_code = tail_code[sx[sb]][delta[sb]]; unsigned int cur_k = k[sb]; unsigned int cur_s = s[sb]; - for (; i < sb_length; i++) { + for (; start < sb_length; start++) { int32_t res = *current_res; if (res == cur_tail_code) { @@ -1348,7 +1348,7 @@ static int read_frame_data(ALSDecContext *ctx, unsigned int ra_frame) } } else { // multi-channel coding ALSBlockData bd = { 0 }; - int b; + int b, ret; int *reverted_channels = ctx->reverted_channels; unsigned int offset = 0; @@ -1381,8 +1381,10 @@ static int read_frame_data(ALSDecContext *ctx, unsigned int ra_frame) bd.raw_samples = ctx->raw_samples[c] + offset; bd.raw_other = NULL; - if (read_block(ctx, &bd) || read_channel_data(ctx, ctx->chan_data[c], c)) - return -1; + if ((ret = read_block(ctx, &bd)) < 0) + return ret; + if ((ret = read_channel_data(ctx, ctx->chan_data[c], c)) < 0) + return ret; } for (c = 0; c < avctx->channels; c++) @@ -1401,8 +1403,9 @@ static int read_frame_data(ALSDecContext *ctx, unsigned int ra_frame) bd.lpc_cof = ctx->lpc_cof[c]; bd.quant_cof = ctx->quant_cof[c]; bd.raw_samples = ctx->raw_samples[c] + offset; - if (decode_block(ctx, &bd)) - return -1; + + if ((ret = decode_block(ctx, &bd)) < 0) + return ret; } memset(reverted_channels, 0, avctx->channels * sizeof(*reverted_channels));