The values are allowed to go over the imposed limit, and they do in the
default above.
---
libavcodec/flacenc.c | 20 ++++----------------
1 file changed, 4 insertions(+), 16 deletions(-)
diff --git a/libavcodec/flacenc.c b/libavcodec/flacenc.c
index 58961b8..1341dfd 100644
--- a/libavcodec/flacenc.c
+++ b/libavcodec/flacenc.c
@@ -328,14 +328,8 @@ static av_cold int flac_encode_init(AVCodecContext *avctx)
if (s->options.lpc_type == FF_LPC_TYPE_NONE) {
s->options.min_prediction_order = 0;
} 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 -1;
- }
- } else if (avctx->min_prediction_order < MIN_LPC_ORDER ||
- avctx->min_prediction_order > MAX_LPC_ORDER) {
+ if (avctx->min_prediction_order < MIN_LPC_ORDER ||
+ avctx->min_prediction_order > MAX_LPC_ORDER) {
av_log(avctx, AV_LOG_ERROR, "invalid min prediction order: %d\n",
avctx->min_prediction_order);
return -1;
@@ -345,14 +339,8 @@ static av_cold int flac_encode_init(AVCodecContext *avctx)
if (s->options.lpc_type == FF_LPC_TYPE_NONE) {
s->options.max_prediction_order = 0;
} 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 -1;
- }
- } else if (avctx->max_prediction_order < MIN_LPC_ORDER ||
- avctx->max_prediction_order > MAX_LPC_ORDER) {
+ if (avctx->max_prediction_order < MIN_LPC_ORDER ||
+ avctx->max_prediction_order > MAX_LPC_ORDER) {
av_log(avctx, AV_LOG_ERROR, "invalid max prediction order: %d\n",
avctx->max_prediction_order);
return -1;
--
1.9.5 (Apple Git-50.3)
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel