diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index 95fb65ad4336e068f09bbd91c179463b27f6a8f8..0ac81ba333e01c3d38af408830acfa9be9e2bbf5 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -601,10 +601,9 @@ int attribute_align_arg avcodec_open2(AVCodecContext *avctx, AVCodec *codec, AVD
     }
 
     if (avctx->codec->max_lowres < avctx->lowres || avctx->lowres < 0) {
-        av_log(avctx, AV_LOG_ERROR, "The maximum value for lowres supported by the decoder is %d\n",
+        av_log(avctx, AV_LOG_WARNING, "The maximum value for lowres supported by the decoder is %d\n",
                avctx->codec->max_lowres);
-        ret = AVERROR(EINVAL);
-        goto free_and_end;
+        avctx->lowres = avctx->codec->max_lowres;
     }
     if (avctx->codec->encode) {
         int i;