summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--glslview.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/glslview.c b/glslview.c
index fd0b180..1bb84e2 100644
--- a/glslview.c
+++ b/glslview.c
@@ -207,7 +207,7 @@ static void savePNG(int width, int height, const char *output_dir) {
uint8_t *row_pointers[height];
for (size_t i = 0; i < height; i++)
- row_pointers[i] = &pixels[4*i*width];
+ row_pointers[i] = &pixels[4*(height-1-i)*width];
png_set_rows(png_ptr, info_ptr, row_pointers);
png_write_png(png_ptr, info_ptr, PNG_TRANSFORM_IDENTITY, NULL);