summaryrefslogtreecommitdiffstatshomepage
path: root/src/lib/formats/csw_cas.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/formats/csw_cas.cpp')
-rw-r--r--src/lib/formats/csw_cas.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/lib/formats/csw_cas.cpp b/src/lib/formats/csw_cas.cpp
index db7cf4d4248..3b07576254b 100644
--- a/src/lib/formats/csw_cas.cpp
+++ b/src/lib/formats/csw_cas.cpp
@@ -288,6 +288,12 @@ static const struct CassetteLegacyWaveFiller csw_legacy_fill_wave = {
static cassette_image::error csw_cassette_identify( cassette_image *cassette, struct CassetteOptions *opts )
{
+ UINT8 header[22];
+
+ cassette_image_read(cassette, header, 0, sizeof(header));
+ if (memcmp(&header[0], CSW_HEADER, sizeof(CSW_HEADER) - 1)) {
+ return cassette_image::error::INVALID_IMAGE;
+ }
return cassette_legacy_identify( cassette, opts, &csw_legacy_fill_wave );
}