Browse Source

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>
tags/n0.8
ami_stuff Michael Niedermayer 14 years ago
parent
commit
7a54edaa16
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      libavcodec/utils.c

+ 1
- 1
libavcodec/utils.c View File

@@ -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);


Loading…
Cancel
Save