Commit 7a54edaa authored by ami_stuff's avatar ami_stuff Committed by Michael Niedermayer

Fail when lowres value is lower than 0

The attached patch fixes the crash which happens when user passes lowres value lower than 0 to FFplay.

ffplay -lowres -1 test.mpg
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent b49728df
......@@ -563,7 +563,7 @@ int attribute_align_arg avcodec_open(AVCodecContext *avctx, AVCodec *codec)
}
}
if (avctx->codec->max_lowres < avctx->lowres) {
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",
avctx->codec->max_lowres);
ret = AVERROR(EINVAL);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment