mirror of
https://github.com/libretro/RetroArch
synced 2025-04-01 04:20:27 +00:00
backport 'add guard for unknown roms with 8MB or more'
This commit is contained in:
parent
426033b4d1
commit
677d757c18
@ -1301,13 +1301,13 @@ int cheevos_get_by_content( const char** json, const void* data, size_t size )
|
||||
|
||||
game_id = cheevos_get_game_id( hash );
|
||||
|
||||
if ( !game_id )
|
||||
if ( !game_id && size < CHEEVOS_EIGHT_MB )
|
||||
{
|
||||
/* If the content is a SNES game, continue MD5 with zeroes. */
|
||||
/* Maybe the content is a SNES game, continue MD5 with zeroes up to 8MB. */
|
||||
size = CHEEVOS_EIGHT_MB - size;
|
||||
memset( (void*)buffer, 0, sizeof( buffer ) );
|
||||
|
||||
while ( size )
|
||||
do
|
||||
{
|
||||
len = sizeof( buffer );
|
||||
|
||||
@ -1316,7 +1316,7 @@ int cheevos_get_by_content( const char** json, const void* data, size_t size )
|
||||
|
||||
MD5_Update( &saved_ctx, (void*)buffer, len );
|
||||
size -= len;
|
||||
}
|
||||
}while(size);
|
||||
|
||||
MD5_Final( hash, &saved_ctx );
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user