On Sun, Jul 17, 2016 at 05:03:35PM +0200, Clément Bœsch wrote: > There is actually a need for the origin and end point not to be defined. > We can not automatically insert them with the y value of the first and > last point as it will influence the curves in a wrong way. > > Fixes #5397 > --- > Changelog | 1 + > doc/filters.texi | 10 ++---- > libavfilter/version.h | 2 +- > libavfilter/vf_curves.c | 85 > ++++++++++++++++++++++++------------------------- > 4 files changed, 47 insertions(+), 51 deletions(-) [...] > @@ -177,30 +177,6 @@ static int parse_points_str(AVFilterContext *ctx, struct > keypoint **points, cons > last = point; > } > > - /* auto insert first key point if missing at x=0 */ > - if (!*points) { > - last = make_point(0, 0, NULL); > - if (!last) > - return AVERROR(ENOMEM); > - last->x = last->y = 0; > - *points = last; > - } else if ((*points)->x != 0.) { > - struct keypoint *newfirst = make_point(0, 0, *points); > - if (!newfirst) > - return AVERROR(ENOMEM); > - *points = newfirst; > - } > - > - av_assert0(last); > - > - /* auto insert last key point if missing at x=1 */ > - if (last->x != 1.) { > - struct keypoint *point = make_point(1, 1, NULL); > - if (!point) > - return AVERROR(ENOMEM); > - last->next = point; > - } > -
Added the following warning locally: if (*points && !(*points)->next) { av_log(ctx, AV_LOG_WARNING, "Only one point (at (%f;%f)) is defined, " "this is unlikely to behave as you expect. You probably want" "at least 2 points.", (*points)->x, (*points)->y); } > return 0; > } > > @@ -225,11 +201,25 @@ static int interpolate(AVFilterContext *ctx, uint8_t > *y, const struct keypoint * > const struct keypoint *point; changed locally to const struct keypoint *point = NULL; to prevent a crash in case of only one point defined. [...] -- Clément B.
signature.asc
Description: PGP signature
_______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel