changeset 378:5dde74cf43b3

Actually seek to the SID dataOffset when starting to read it.
author Matti Hamalainen <ccr@tnsp.org>
date Mon, 11 Oct 2021 07:52:42 +0300
parents 860fe188665d
children 79c9ed0977ee
files sidlib.c
diffstat 1 files changed, 8 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/sidlib.c	Sat Oct 09 16:20:45 2021 +0300
+++ b/sidlib.c	Mon Oct 11 07:52:42 2021 +0300
@@ -183,6 +183,14 @@
 
     hdrEnd = thftell(ctx);
 
+    // Seek to data
+    if (thfseek(ctx, psid->dataOffset, SEEK_SET) < 0)
+    {
+        ret = th_io_error(ctx, ctx->status,
+            "Error seeking to SID data.");
+        goto exit;
+    }
+
     // If load address is 0, we need to get it
     if (psid->loadAddress == 0 &&
         !thfread_le16(ctx, &psid->loadAddress))