]> git.sesse.net Git - ffmpeg/blobdiff - libavfilter/vf_cover_rect.c
avformat/asfdec: do not define print_guid() to nothing
[ffmpeg] / libavfilter / vf_cover_rect.c
index 7e1a9f449ddbfec4aaec8e97e3926b5777fb0ee9..d12807ad53ed55b78f49cff817e59bf7bf29dacb 100644 (file)
@@ -163,6 +163,17 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
         return ff_filter_frame(ctx->outputs[0], in);
     }
 
+    if (x < 0) {
+        w += x;
+        x = 0;
+    }
+    if (y < 0) {
+        h += y;
+        y = 0;
+    }
+    w = FFMIN(w, in->width  - x);
+    h = FFMIN(h, in->height - y);
+
     if (w > in->width || h > in->height || w <= 0 || h <= 0)
         return AVERROR(EINVAL);