1
mirror of https://git.videolan.org/git/ffmpeg.git synced 2024-07-15 00:41:37 +02:00

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
This commit is contained in:
Stefano Sabatini 2012-03-19 20:06:06 +01:00
parent 11642cd16f
commit e19ccc89ef

View File

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