From 52034b00ebd271b29697dea94b6bb75fa0b5695d Mon Sep 17 00:00:00 2001
From: Uwe Bonnes <bon@elektron.ikp.physik.tu-darmstadt.de>
Date: Mon, 7 Aug 2000 02:33:26 +0000
Subject: [PATCH] X11DRV_DIB_SetImageBits_RLE8: break image lines.

---
 graphics/x11drv/dib.c | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/graphics/x11drv/dib.c b/graphics/x11drv/dib.c
index 2d1874d2bd7..22c0dac60f3 100644
--- a/graphics/x11drv/dib.c
+++ b/graphics/x11drv/dib.c
@@ -1254,7 +1254,14 @@ static void X11DRV_DIB_SetImageBits_RLE8( int lines, const BYTE *bits,
 		color = colors[color_index];
 
 		while(length--)
-		  XPutPixel(bmpImage, x++, line, color);
+		  {
+		    if (x>=dstwidth)
+		      {
+			x=0;
+			line--;
+		      }
+		    XPutPixel(bmpImage, x++, line, color);
+		  }
 	    }
 	  else 
 	    {    
@@ -1317,6 +1324,11 @@ static void X11DRV_DIB_SetImageBits_RLE8( int lines, const BYTE *bits,
 			  while(length--)
 			    {
 				color_index = (*pIn++);
+				if (x>=dstwidth)
+				  {
+				    x=0;
+				    line--;
+				  }
 				XPutPixel(bmpImage, x++, line, 
 					  colors[color_index]);
 			    }
-- 
GitLab