diff sidlib.c @ 133:9cfa0553e7f9

Add support for reading PSID/RSID v4 in sidlib.
author Matti Hamalainen <ccr@tnsp.org>
date Fri, 02 Jun 2017 02:39:15 +0300
parents b3e034b8c4b9
children 27365eae837b
line wrap: on
line diff
--- a/sidlib.c	Fri Jun 02 02:38:41 2017 +0300
+++ b/sidlib.c	Fri Jun 02 02:39:15 2017 +0300
@@ -92,7 +92,7 @@
 
     if ((psid->magic[0] != 'R' && psid->magic[0] != 'P') ||
         psid->magic[1] != 'S' || psid->magic[2] != 'I' || psid->magic[3] != 'D' ||
-        psid->version < 1 || psid->version > 3)
+        psid->version < 1 || psid->version > 4)
     {
         th_io_error(ctx, THERR_NOT_SUPPORTED,
             "Not a supported PSID or RSID file.\n");
@@ -118,7 +118,8 @@
         if (!thfread_be16(ctx, &psid->flags) ||
             !thfread_u8(ctx, &psid->startPage) ||
             !thfread_u8(ctx, &psid->pageLength) ||
-            !thfread_be16(ctx, &psid->reserved))
+            !thfread_u8(ctx, &psid->sid2Addr) ||
+            !thfread_u8(ctx, &psid->sid3Addr))
         {
             th_io_error(ctx, ctx->status,
                 "Error reading PSID/RSID v2+ extra header data: %s.\n",