1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

lavfi/aspect: check for a negative code from av_parse_ratio()

Check on < 0 rather than on != 0, this is more correct as a positive
error code from av_parse_ratio() value doesn't mean an error.
This commit is contained in:
Stefano Sabatini 2012-03-21 14:39:24 +01:00
parent 6cf53927c4
commit e71e65ff1d

View File

@ -37,7 +37,7 @@ static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque)
aspect->ratio = (AVRational) {0, 1};
if (args) {
if (av_parse_ratio(&aspect->ratio, args, 100, 0, ctx) ||
if (av_parse_ratio(&aspect->ratio, args, 100, 0, ctx) < 0 ||
aspect->ratio.num < 0 || aspect->ratio.den <= 0) {
av_log(ctx, AV_LOG_ERROR,
"Invalid string '%s' for aspect ratio.\n", args);