Commit 6c074417 authored by Libretro-Admin's avatar Libretro-Admin
Browse files

Get past crash in CalcGameID

parent 3a5f2f8a
......@@ -910,7 +910,7 @@ static bool IsSaturnDisc(const uint8* sa32k)
static void CalcGameID(uint8* id_out16, uint8* fd_id_out16, char* sgid)
{
md5_context mctx;
uint8_t *buf = new uint8_t[2048];
uint8_t buf[2048];
log_cb(RETRO_LOG_INFO, "Start calculating game ID, discs: %d...\n", cdifs ? cdifs->size() : 0);
......@@ -944,7 +944,7 @@ static void CalcGameID(uint8* id_out16, uint8* fd_id_out16, char* sgid)
if(i == 0)
{
char* tmp;
memcpy(sgid, (void*)(buf[0x20]), 16);
memcpy(sgid, (void*)(&buf[0x20]), 16);
sgid[16] = 0;
if((tmp = strrchr(sgid, 'V')))
{
......@@ -966,9 +966,6 @@ static void CalcGameID(uint8* id_out16, uint8* fd_id_out16, char* sgid)
}
}
if (buf)
free(buf);
mctx.finish(id_out16);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment