From 527da3c3bb8e367c731b7fe437f1283b2a549912 Mon Sep 17 00:00:00 2001 From: "SND\\MaddTheSane_cp" Date: Sat, 7 Feb 2015 22:17:23 +0000 Subject: OS X: Fix an off-by-one error that was causing the QuickLook and Spotlight plug-ins to crash. The bug was also present in the app itself, but it didn't crash. git-svn-id: https://pcsxr.svn.codeplex.com/svn/pcsxr@93874 e17a0e51-4ae3-4d35-97c3-1a29b211df97 --- macosx/Psx-Memcard/GetMetadataForFile.m | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'macosx/Psx-Memcard/GetMetadataForFile.m') diff --git a/macosx/Psx-Memcard/GetMetadataForFile.m b/macosx/Psx-Memcard/GetMetadataForFile.m index 41e0e224..78adda93 100644 --- a/macosx/Psx-Memcard/GetMetadataForFile.m +++ b/macosx/Psx-Memcard/GetMetadataForFile.m @@ -172,7 +172,7 @@ Boolean GetMetadataForFile(void *thisInterface, CFMutableDictionaryRef attribute i++; continue; } - do { + while (i + x < MAX_MEMCARD_BLOCKS) { McdBlock tmpBlock; GetSoloBlockInfo((unsigned char *)fileCData, i + x + 1, &tmpBlock); if ((tmpBlock.Flags & 0x3) == 0x3) { @@ -183,7 +183,7 @@ Boolean GetMetadataForFile(void *thisInterface, CFMutableDictionaryRef attribute } else { break; } - } while (i + x - 1 < MAX_MEMCARD_BLOCKS); + }; // Ignore deleted blocks i += x; if (MemBlockFlag(memBlock.Flags) == memFlagDeleted) { -- cgit v1.2.3