diff --git a/libavcodec/alsdec.c b/libavcodec/alsdec.c index cfe8fd37cb..4f4176ecee 100644 --- a/libavcodec/alsdec.c +++ b/libavcodec/alsdec.c @@ -704,6 +704,10 @@ static int read_var_block_data(ALSDecContext *ctx, ALSBlockData *bd) int rice_param = parcor_rice_table[sconf->coef_table][k][1]; 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, "quant_cof %d is out of range\n", quant_cof[k]); + return AVERROR_INVALIDDATA; + } } // read coefficients 20 to 126