From e6140e756e21f39550037f438d9240556b656f84 Mon Sep 17 00:00:00 2001
From: Ozkan Sezer <[EMAIL REDACTED]>
Date: Sat, 28 Feb 2026 05:05:40 +0300
Subject: [PATCH] decoder_xmp.c: Fixed xmp_seek_time error check. Thanks
@BeWorld2018
Fixes https://github.com/libsdl-org/SDL_mixer/issues/821
---
src/decoder_xmp.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/src/decoder_xmp.c b/src/decoder_xmp.c
index d7b2660c..ece8b9ef 100644
--- a/src/decoder_xmp.c
+++ b/src/decoder_xmp.c
@@ -275,7 +275,7 @@ static bool SDLCALL XMP_seek(void *track_userdata, Uint64 frame)
}
const int err = libxmp.xmp_seek_time(tdata->ctx, (int) ms);
libxmp.xmp_play_buffer(tdata->ctx, NULL, 0, 0); // reset the internal state.
- return err ? SetLibXmpError("xmp_seek_time", err) : true;
+ return err < 0 ? SetLibXmpError("xmp_seek_time", err) : true;
}
static void SDLCALL XMP_quit_track(void *track_userdata)
@@ -306,4 +306,3 @@ const MIX_Decoder MIX_Decoder_XMP = {
};
#endif
-