changeset 379:79c9ed0977ee

Check error value when seeking to start of the SID header.
author Matti Hamalainen <ccr@tnsp.org>
date Mon, 11 Oct 2021 07:52:56 +0300
parents 5dde74cf43b3
children d84ca3fb42bf
files sidlib.c
diffstat 1 files changed, 6 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/sidlib.c	Mon Oct 11 07:52:42 2021 +0300
+++ b/sidlib.c	Mon Oct 11 07:52:56 2021 +0300
@@ -207,7 +207,12 @@
     {
         // New Songlengths.md5 style hash calculation:
         // We just hash the whole file, so seek back to beginning ..
-        thfseek(ctx, hdrStart, SEEK_SET);
+        if (thfseek(ctx, hdrStart, SEEK_SET) < 0)
+        {
+            ret = th_io_error(ctx, ctx->status,
+                "Error seeking to SID header start.");
+            goto exit;
+        }
 
         if ((ret = sidlib_read_hash_data(ctx, psid, &state)) != THERR_OK)
             goto exit;