From 6d5d88f01ed467cb576d2e7bc94708ad5d212f0f Mon Sep 17 00:00:00 2001 From: whitequark Date: Mon, 25 Jul 2016 00:51:24 +0000 Subject: [PATCH] Fix off-by-one bug in Pixmap::WritePng. --- src/resource.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/resource.cpp b/src/resource.cpp index 4bd8903..b5be272 100644 --- a/src/resource.cpp +++ b/src/resource.cpp @@ -186,7 +186,7 @@ bool Pixmap::WritePng(FILE *f, bool flip) { if(flip) { rows.push_back(&data[stride * y]); } else { - rows.push_back(&data[stride * (height - y)]); + rows.push_back(&data[stride * (height - y - 1)]); } }