]> git.sesse.net Git - ffmpeg/blobdiff - libavfilter/vf_colorspace.c
Merge commit '3db51bf671defd47f2ec5ab67b11fb7730fb5e5a'
[ffmpeg] / libavfilter / vf_colorspace.c
index c7a2286813a23a90b792e07f4dad04829f5dc60d..0024505a44ffb13fa7331823ea7af3a1bbdf1feb 100644 (file)
@@ -168,7 +168,7 @@ typedef struct ColorSpaceContext {
     int did_warn_range;
 } ColorSpaceContext;
 
-// FIXME deal with odd width/heights (or just forbid it)
+// FIXME deal with odd width/heights
 // FIXME faster linearize/delinearize implementation (integer pow)
 // FIXME bt2020cl support (linearization between yuv/rgb step instead of between rgb/xyz)
 // FIXME test that the values in (de)lin_lut don't exceed their container storage
@@ -1031,8 +1031,15 @@ static int query_formats(AVFilterContext *ctx)
 
 static int config_props(AVFilterLink *outlink)
 {
+    AVFilterContext *ctx = outlink->dst;
     AVFilterLink *inlink = outlink->src->inputs[0];
 
+    if (inlink->w % 2 || inlink->h % 2) {
+        av_log(ctx, AV_LOG_ERROR, "Invalid odd size (%dx%d)\n",
+               inlink->w, inlink->h);
+        return AVERROR_PATCHWELCOME;
+    }
+
     outlink->w = inlink->w;
     outlink->h = inlink->h;
     outlink->sample_aspect_ratio = inlink->sample_aspect_ratio;