From 71819202385f9090dacddce16cbaa35abf10baf8 Mon Sep 17 00:00:00 2001 From: Bruce Evans Date: Fri, 26 Apr 2019 13:04:10 +0000 Subject: [PATCH] Fix an off-by-1 error for copying overlapping bitmaps in r346416. For nonzero height, the first line in the original order was not copied, and for zero height, garbage lines before the first were copied until a crash occurred. --- lib/libvgl/bitmap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/libvgl/bitmap.c b/lib/libvgl/bitmap.c index eafced3cc7e0..0a7f049d9fa0 100644 --- a/lib/libvgl/bitmap.c +++ b/lib/libvgl/bitmap.c @@ -207,7 +207,7 @@ __VGLBitmapCopy(VGLBitmap *src, int srcx, int srcy, yextra = 0; ystep = 1; if (src->Bitmap == dst->Bitmap && srcy < dsty) { - yend = srcy; + yend = srcy - 1; yextra = hight - 1; ystep = -1; }