Skip to content

Commit

Permalink
Std_File_Reader::read: move corrupt file check after NULL FILE* check.
Browse files Browse the repository at this point in the history
  • Loading branch information
sezero committed Jan 10, 2025
1 parent bcd4581 commit 95e69ac
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion gme/Data_Reader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -390,8 +390,8 @@ long Std_File_Reader::read_avail( void* p, long s )

blargg_err_t Std_File_Reader::read( void* p, long s )
{
RETURN_VALIDITY_CHECK( s > 0 && static_cast<unsigned long>(s) <= UINT_MAX );
if (!file_) return "NULL FILE pointer";
RETURN_VALIDITY_CHECK( s > 0 && static_cast<unsigned long>(s) <= UINT_MAX );
#ifdef HAVE_ZLIB_H
const auto &gzfile = reinterpret_cast<gzFile>( file_ );
if ( s == gzread( gzfile, p, static_cast<unsigned>( s ) ) )
Expand Down

0 comments on commit 95e69ac

Please sign in to comment.