aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorami_stuff <ami_stuff@o2.pl>2011-05-25 19:53:38 +0200
committerMichael Niedermayer <michaelni@gmx.at>2011-05-25 23:42:56 +0200
commit7a54edaa16be3673a2ae8110d1777462c7f6ed7c (patch)
tree09a86af151a552bb824bf65a49372a480b5ea274 /libavcodec
parentb49728df732109c270af47f98b0d380cb1454c2a (diff)
downloadffmpeg-7a54edaa16be3673a2ae8110d1777462c7f6ed7c.tar.gz
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>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/utils.c2
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);