# HG changeset patch # User Matti Hamalainen # Date 1633927976 -10800 # Node ID 79c9ed0977eec05815d7318420365b18382ed3c1 # Parent 5dde74cf43b37e54201ba01a382f05228e4ee0d1 Check error value when seeking to start of the SID header. diff -r 5dde74cf43b3 -r 79c9ed0977ee sidlib.c --- 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;