From 12b4f81c9f8c3845124df9160bf83415d3c8fecd Mon Sep 17 00:00:00 2001 From: Kreeblah Date: Sun, 24 Jan 2021 02:15:25 -0800 Subject: [PATCH] Added additional check for header retrieval --- Cart_Reader/NES.ino | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Cart_Reader/NES.ino b/Cart_Reader/NES.ino index 2cede86..5cc6697 100644 --- a/Cart_Reader/NES.ino +++ b/Cart_Reader/NES.ino @@ -724,7 +724,7 @@ void CreateRAMFileInSD() { void outputNES() { display_Clear(); - uint32_t prg_crc32; + uint32_t prg_crc32 = 0; File prg_crc32_file; if(prg_crc32_file.open(filePRG, O_READ)) { @@ -831,6 +831,11 @@ void CartFinish() { unsigned char* getNESHeaderForFileInfo(size_t prg_size, size_t chr_size, uint32_t prg_crc32, uint32_t chr_crc32) { + if(prg_size == 0) + { + return NULL; + } + File nesDb; char* temp_line; int i;