diff options
author | Derek Buitenhuis <derek.buitenhuis@gmail.com> | 2015-11-22 20:10:42 +0300 |
---|---|---|
committer | Derek Buitenhuis <derek.buitenhuis@gmail.com> | 2015-11-22 20:10:42 +0300 |
commit | 5ebaf1e1cbee6097264b594dc66177cc1b6daaf2 (patch) | |
tree | 9e60cd2c32ebab2868ecabfeccc702676eff636b | |
parent | bba2488f074904069e38865654413ec44d35ec24 (diff) | |
parent | 79d89cf2f4b62eeb653fd8139041c87e75f7ca65 (diff) |
Merge commit '79d89cf2f4b62eeb653fd8139041c87e75f7ca65'
* commit '79d89cf2f4b62eeb653fd8139041c87e75f7ca65':
flacenc: Clamp user-supplied min/max prediction orders
Conflicts:
libavcodec/flacenc.c
Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
-rw-r--r-- | libavcodec/flacenc.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/libavcodec/flacenc.c b/libavcodec/flacenc.c index e87fdc1870..b5e9ac6578 100644 --- a/libavcodec/flacenc.c +++ b/libavcodec/flacenc.c @@ -340,9 +340,10 @@ static av_cold int flac_encode_init(AVCodecContext *avctx) } else if (avctx->min_prediction_order >= 0) { if (s->options.lpc_type == FF_LPC_TYPE_FIXED) { if (avctx->min_prediction_order > MAX_FIXED_ORDER) { - av_log(avctx, AV_LOG_ERROR, "invalid min prediction order: %d\n", - avctx->min_prediction_order); - return AVERROR(EINVAL); + av_log(avctx, AV_LOG_WARNING, + "invalid min prediction order %d, clamped to %d\n", + avctx->min_prediction_order, MAX_FIXED_ORDER); + avctx->min_prediction_order = MAX_FIXED_ORDER; } } else if (avctx->min_prediction_order < MIN_LPC_ORDER || avctx->min_prediction_order > MAX_LPC_ORDER) { @@ -357,9 +358,10 @@ static av_cold int flac_encode_init(AVCodecContext *avctx) } else if (avctx->max_prediction_order >= 0) { if (s->options.lpc_type == FF_LPC_TYPE_FIXED) { if (avctx->max_prediction_order > MAX_FIXED_ORDER) { - av_log(avctx, AV_LOG_ERROR, "invalid max prediction order: %d\n", - avctx->max_prediction_order); - return AVERROR(EINVAL); + av_log(avctx, AV_LOG_WARNING, + "invalid max prediction order %d, clamped to %d\n", + avctx->max_prediction_order, MAX_FIXED_ORDER); + avctx->max_prediction_order = MAX_FIXED_ORDER; } } else if (avctx->max_prediction_order < MIN_LPC_ORDER || avctx->max_prediction_order > MAX_LPC_ORDER) { |