From 4fa2653394150140c4d69cf66a78cd83e1175f99 Mon Sep 17 00:00:00 2001 From: Ozkan Sezer Date: Tue, 12 Jul 2022 00:55:00 +0300 Subject: [PATCH] SDL_GetJoystickGUIDInfo: byte-swap vendor, product and version values. Reference issue: https://github.com/libsdl-org/SDL/issues/5907 --- src/joystick/SDL_joystick.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/joystick/SDL_joystick.c b/src/joystick/SDL_joystick.c index 5ce191fcb..6fc32f7de 100644 --- a/src/joystick/SDL_joystick.c +++ b/src/joystick/SDL_joystick.c @@ -1759,15 +1759,15 @@ void SDL_GetJoystickGUIDInfo(SDL_JoystickGUID guid, Uint16 *vendor, Uint16 *prod /* guid16[4] is product ID */ guid16[5] == 0x0000 /* guid16[6] is product version */ - ) { + ) { if (vendor) { - *vendor = guid16[2]; + *vendor = SDL_SwapLE16(guid16[2]); } if (product) { - *product = guid16[4]; + *product = SDL_SwapLE16(guid16[4]); } if (version) { - *version = guid16[6]; + *version = SDL_SwapLE16(guid16[6]); } } else { if (vendor) {