From 278aa141e3317b6371f7d67e0f936638337d412c Mon Sep 17 00:00:00 2001 From: Christoph Hohmann Date: Sun, 5 Oct 2014 22:54:16 +0200 Subject: [PATCH] Fix creating textures from image data with flipping When the image data is copied into a texture with flipping set to true each row has to be copied into the (height - row - 1)th row instead of the row with the same number. Otherwise it will just create an unflipped copy. --- libobs/graphics/graphics.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libobs/graphics/graphics.c b/libobs/graphics/graphics.c index aae2e439e..4a17affab 100644 --- a/libobs/graphics/graphics.c +++ b/libobs/graphics/graphics.c @@ -891,7 +891,7 @@ void gs_texture_set_image(gs_texture_t *tex, const uint8_t *data, if (flip) { for (y = height-1; y >= 0; y--) memcpy(ptr + (uint32_t)y * linesize_out, - data + (uint32_t)y * linesize, + data + (uint32_t)(height - y - 1) * linesize, row_copy); } else if (linesize == linesize_out) {