diff options
author | ami_stuff <ami_stuff@o2.pl> | 2011-05-25 21:53:38 +0400 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2011-05-26 01:42:56 +0400 |
commit | 7a54edaa16be3673a2ae8110d1777462c7f6ed7c (patch) | |
tree | 09a86af151a552bb824bf65a49372a480b5ea274 | |
parent | b49728df732109c270af47f98b0d380cb1454c2a (diff) |
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: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | libavcodec/utils.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/utils.c b/libavcodec/utils.c index 5354459866..95f41f315a 100644 --- a/libavcodec/utils.c +++ b/libavcodec/utils.c @@ -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); |