[FFmpeg-cvslog] Fail when lowres value is lower than 0

ami_stuff git at videolan.org
Thu May 26 02:00:08 CEST 2011


ffmpeg | branch: master | ami_stuff <ami_stuff at o2.pl> | Wed May 25 19:53:38 2011 +0200| [7a54edaa16be3673a2ae8110d1777462c7f6ed7c] | committer: 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: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=7a54edaa16be3673a2ae8110d1777462c7f6ed7c
---

 libavcodec/utils.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index 5354459..95f41f3 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);



More information about the ffmpeg-cvslog mailing list