shithub: npe

Download patch

ref: 6884d431e470eb75796fc408565ac0ecfba783e7
parent: e3faf0f0cf70454fad0eec65a4e058c4dcab26c1
author: Sigrid Solveig Haflínudóttir <sigrid@ftrv.se>
date: Mon Aug 7 21:35:06 EDT 2023

SDL_UpdateTexture: fix pitch comparison

--- a/libnpe_sdl2/sdl2.c
+++ b/libnpe_sdl2/sdl2.c
@@ -262,7 +262,7 @@
 
 	r = re ? Rect(re->x, re->y, re->x+re->w, re->y+re->h) : t->m->r;
 	pix = pixels;
-	if(pitch == Dx(r)){
+	if(pitch == Dx(r)*4){
 		if(loadmemimage(t->m, r, pix, Dx(r)*Dy(r)*4) < 0){
 			werrstr("SDL_UpdateTexture: %r");
 			return -1;