[SCM] libav/experimental: Make init() return sensible error code rather than -1 in case of invalid values.

siretart at users.alioth.debian.org siretart at users.alioth.debian.org
Sun Jun 30 17:16:29 UTC 2013


The following commit has been merged in the experimental branch:
commit c10676aca3815431e553a161fc694dc664f25f2d
Author: Stefano Sabatini <stefano.sabatini-lala at poste.it>
Date:   Tue Sep 28 14:59:09 2010 +0000

    Make init() return sensible error code rather than -1 in case of
    invalid values.
    
    Originally committed as revision 25248 to svn://svn.ffmpeg.org/ffmpeg/trunk

diff --git a/libavfilter/vf_scale.c b/libavfilter/vf_scale.c
index 5d015a9..d99e0c1 100644
--- a/libavfilter/vf_scale.c
+++ b/libavfilter/vf_scale.c
@@ -58,7 +58,7 @@ static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque)
     /* sanity check params */
     if (scale->w <  -1 || scale->h <  -1) {
         av_log(ctx, AV_LOG_ERROR, "Size values less than -1 are not acceptable.\n");
-        return -1;
+        return AVERROR(EINVAL);
     }
     if (scale->w == -1 && scale->h == -1)
         scale->w = scale->h = 0;

-- 
Libav/FFmpeg packaging



More information about the pkg-multimedia-commits mailing list