From e86c0bd1b2f855c53c78be0a7269e1132bc1daf6 Mon Sep 17 00:00:00 2001
From: tue46wsdgxfjrt <jfbvxt@gmail.com>
Date: Tue, 9 Sep 2014 18:05:44 -0700
Subject: [PATCH] Avoid returning negative rectangles from cropdetect

---
 libavfilter/vf_cropdetect.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/libavfilter/vf_cropdetect.c b/libavfilter/vf_cropdetect.c
index 76aa7b2..4b6ee91 100644
--- a/libavfilter/vf_cropdetect.c
+++ b/libavfilter/vf_cropdetect.c
@@ -106,8 +106,8 @@ static int config_input(AVFilterLink *inlink)
 
     s->x1 = inlink->w - 1;
     s->y1 = inlink->h - 1;
-    s->x2 = 0;
-    s->y2 = 0;
+    s->x2 = s->x1;
+    s->y2 = s->y1;
 
     return 0;
 }
@@ -131,8 +131,8 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
         if (s->reset_count > 0 && s->frame_nb > s->reset_count) {
             s->x1 = frame->width  - 1;
             s->y1 = frame->height - 1;
-            s->x2 = 0;
-            s->y2 = 0;
+            s->x2 = s->x1;
+            s->y2 = s->y1;
             s->frame_nb = 1;
         }
 
-- 
1.8.5.2 (Apple Git-48)

