gralloc: pad RGB buffers by a minimum of 2 extra lines

If the buffer is xcrop pixels off the left edge of the screen, xcrop
extra pixels are needed past the 1 line of padding normally expected by
the FIMD.  xcrop is not known at allocation time so assume the worst
case of a full extra line.

Bug: 7304464
Change-Id: I126992eccfb36a402a202a8236a07a5479332812
Signed-off-by: Greg Hackmann <ghackmann@google.com>
diff --git a/gralloc/gralloc.cpp b/gralloc/gralloc.cpp
index e28c005..feaadfd 100644
--- a/gralloc/gralloc.cpp
+++ b/gralloc/gralloc.cpp
@@ -161,8 +161,8 @@
     if (format != HAL_PIXEL_FORMAT_BLOB) {
         bpr = ALIGN(w*bpp, 16);
         vstride = ALIGN(h, 16);
-        if (vstride == h)
-            size = bpr * (vstride + 1);
+        if (vstride < h + 2)
+            size = bpr * (h + 2);
         else
             size = bpr * vstride;
         *stride = bpr / bpp;