[FFmpeg-cvslog] lavfi/aspect: fail with AVERROR(EINVAL) in case of invalid specified aspect

Stefano Sabatini git at videolan.org
Mon Mar 19 20:10:19 CET 2012


ffmpeg | branch: master | Stefano Sabatini <stefasab at gmail.com> | Mon Mar 19 20:06:06 2012 +0100| [e19ccc89ef90dcc8ecc5e3e539761a6a6eccbcef] | committer: Stefano Sabatini

lavfi/aspect: fail with AVERROR(EINVAL) in case of invalid specified aspect

Previously it was returning 0 in case the aspect was parsable but
invalid.

X-ColaCount: +10*PHIl

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

 libavfilter/vf_aspect.c |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/libavfilter/vf_aspect.c b/libavfilter/vf_aspect.c
index 89eaf5f..9e3b93b 100644
--- a/libavfilter/vf_aspect.c
+++ b/libavfilter/vf_aspect.c
@@ -34,15 +34,14 @@ typedef struct {
 static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque)
 {
     AspectContext *aspect = ctx->priv;
-    int ret;
     aspect->ratio = (AVRational) {0, 1};
 
     if (args) {
-        if ((ret = av_parse_ratio(&aspect->ratio, args, 100, 0, ctx)) < 0 ||
+        if (av_parse_ratio(&aspect->ratio, args, 100, 0, ctx) ||
             aspect->ratio.num < 0 || aspect->ratio.den <= 0) {
             av_log(ctx, AV_LOG_ERROR,
                    "Invalid string '%s' for aspect ratio.\n", args);
-            return ret;
+            return AVERROR(EINVAL);
         }
     }
 



More information about the ffmpeg-cvslog mailing list