From 42238f88eae1fb896ed459456cb574cc1ea4b706 Mon Sep 17 00:00:00 2001
From: Sam Lantinga <[EMAIL REDACTED]>
Date: Thu, 1 Dec 2022 13:28:48 -0800
Subject: [PATCH] Fixed build after d0bbfdbfb881e5407911d84c12899bd5b442a130
---
src/video/SDL_bmp.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/video/SDL_bmp.c b/src/video/SDL_bmp.c
index be10432459e6..063f4875ae6a 100644
--- a/src/video/SDL_bmp.c
+++ b/src/video/SDL_bmp.c
@@ -697,8 +697,8 @@ int SDL_SaveBMP_RW(SDL_Surface *surface, SDL_RWops *dst, int freedst)
} else {
SDL_InitFormat(&format, SDL_PIXELFORMAT_BGR24);
}
- surface = SDL_ConvertSurface(saveme, &format, 0);
- if (surface == NULL) {
+ intermediate_surface = SDL_ConvertSurface(surface, &format, 0);
+ if (intermediate_surface == NULL) {
SDL_SetError("Couldn't convert image to %d bpp",
format.BitsPerPixel);
}